@@ -4043,11 +4043,8 @@ static inline void __unprepare_ahb2axi_bridge(struct venus_hfi_device *device,
40434043 if (version != (0x5 << 28 | 0x10 << 16 ))
40444044 return ;
40454045
4046- if (!(device -> intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK ))
4047- return ;
4048-
40494046 dprintk (VIDC_ERR ,
4050- "reset axi cbcr to recover from hung \n" );
4047+ "reset axi cbcr to recover\n" );
40514048
40524049 /* read registers */
40534050 axi0_cbcr_status = __read_gcc_register (device , VIDEO_GCC_AXI0_CBCR );
@@ -4800,7 +4797,8 @@ static int __venus_power_on(struct venus_hfi_device *device)
48004797 return rc ;
48014798}
48024799
4803- static void __venus_power_off (struct venus_hfi_device * device )
4800+ static void __venus_power_off (struct venus_hfi_device * device ,
4801+ bool axi_reset )
48044802{
48054803 u32 version ;
48064804
@@ -4810,11 +4808,13 @@ static void __venus_power_off(struct venus_hfi_device *device)
48104808 if (!(device -> intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK ))
48114809 disable_irq_nosync (device -> hal_data -> irq );
48124810
4813- version = __read_register (device , VIDC_WRAPPER_HW_VERSION );
4811+ if (axi_reset )
4812+ version = __read_register (device , VIDC_WRAPPER_HW_VERSION );
48144813
48154814 __disable_unprepare_clks (device );
48164815
4817- __unprepare_ahb2axi_bridge (device , version );
4816+ if (axi_reset )
4817+ __unprepare_ahb2axi_bridge (device , version );
48184818
48194819 device -> intr_status = 0 ;
48204820
@@ -4852,7 +4852,7 @@ static inline int __suspend(struct venus_hfi_device *device)
48524852
48534853 __disable_subcaches (device );
48544854
4855- __venus_power_off (device );
4855+ __venus_power_off (device , false );
48564856 dprintk (VIDC_PROF , "Venus power off\n" );
48574857 return rc ;
48584858
@@ -4927,7 +4927,7 @@ static inline int __resume(struct venus_hfi_device *device)
49274927err_reset_core :
49284928 __tzbsp_set_video_state (TZBSP_VIDEO_STATE_SUSPEND );
49294929err_set_video_state :
4930- __venus_power_off (device );
4930+ __venus_power_off (device , false );
49314931err_venus_power_on :
49324932 dprintk (VIDC_ERR , "Failed to resume from power collapse\n" );
49334933 return rc ;
@@ -4986,7 +4986,7 @@ static int __load_fw(struct venus_hfi_device *device)
49864986 subsystem_put (device -> resources .fw .cookie );
49874987 device -> resources .fw .cookie = NULL ;
49884988fail_load_fw :
4989- __venus_power_off (device );
4989+ __venus_power_off (device , true );
49904990fail_venus_power_on :
49914991fail_init_pkt :
49924992 __deinit_resources (device );
@@ -5007,7 +5007,7 @@ static void __unload_fw(struct venus_hfi_device *device)
50075007 __vote_buses (device , NULL , 0 );
50085008 subsystem_put (device -> resources .fw .cookie );
50095009 __interface_queues_release (device );
5010- __venus_power_off (device );
5010+ __venus_power_off (device , true );
50115011 device -> resources .fw .cookie = NULL ;
50125012 __deinit_resources (device );
50135013
0 commit comments