diff --git a/drivers/media/platform/msm/vidc/venus_hfi.c b/drivers/media/platform/msm/vidc/venus_hfi.c index faf8d6f28d9d0..21e58ea84c1b9 100644 --- a/drivers/media/platform/msm/vidc/venus_hfi.c +++ b/drivers/media/platform/msm/vidc/venus_hfi.c @@ -4043,11 +4043,8 @@ static inline void __unprepare_ahb2axi_bridge(struct venus_hfi_device *device, if (version != (0x5 << 28 | 0x10 << 16)) return; - if (!(device->intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK)) - return; - dprintk(VIDC_ERR, - "reset axi cbcr to recover from hung\n"); + "reset axi cbcr to recover\n"); /* read registers */ 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) return rc; } -static void __venus_power_off(struct venus_hfi_device *device) +static void __venus_power_off(struct venus_hfi_device *device, + bool axi_reset) { u32 version; @@ -4810,11 +4808,13 @@ static void __venus_power_off(struct venus_hfi_device *device) if (!(device->intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK)) disable_irq_nosync(device->hal_data->irq); - version = __read_register(device, VIDC_WRAPPER_HW_VERSION); + if (axi_reset) + version = __read_register(device, VIDC_WRAPPER_HW_VERSION); __disable_unprepare_clks(device); - __unprepare_ahb2axi_bridge(device, version); + if (axi_reset) + __unprepare_ahb2axi_bridge(device, version); device->intr_status = 0; @@ -4852,7 +4852,7 @@ static inline int __suspend(struct venus_hfi_device *device) __disable_subcaches(device); - __venus_power_off(device); + __venus_power_off(device, false); dprintk(VIDC_PROF, "Venus power off\n"); return rc; @@ -4927,7 +4927,7 @@ static inline int __resume(struct venus_hfi_device *device) err_reset_core: __tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); err_set_video_state: - __venus_power_off(device); + __venus_power_off(device, false); err_venus_power_on: dprintk(VIDC_ERR, "Failed to resume from power collapse\n"); return rc; @@ -4986,7 +4986,7 @@ static int __load_fw(struct venus_hfi_device *device) subsystem_put(device->resources.fw.cookie); device->resources.fw.cookie = NULL; fail_load_fw: - __venus_power_off(device); + __venus_power_off(device, true); fail_venus_power_on: fail_init_pkt: __deinit_resources(device); @@ -5007,7 +5007,7 @@ static void __unload_fw(struct venus_hfi_device *device) __vote_buses(device, NULL, 0); subsystem_put(device->resources.fw.cookie); __interface_queues_release(device); - __venus_power_off(device); + __venus_power_off(device, true); device->resources.fw.cookie = NULL; __deinit_resources(device);