Loading drivers/media/platform/msm/vidc/venus_hfi.c +5 −58 Original line number Original line Diff line number Diff line Loading @@ -1195,44 +1195,6 @@ static enum hal_default_properties venus_hfi_get_default_properties(void *dev) return prop; return prop; } } static int __halt_axi(struct venus_hfi_device *device) { u32 reg; int rc = 0; if (!device) { dprintk(VIDC_ERR, "Invalid input: %pK\n", device); return -EINVAL; } /* * Driver needs to make sure that clocks are enabled to read Venus AXI * registers. If not skip AXI HALT. */ if (!device->power_enabled) { dprintk(VIDC_WARN, "Clocks are OFF, skipping AXI HALT\n"); WARN_ON(1); return -EINVAL; } /* Halt AXI and AXI IMEM VBIF Access */ reg = __read_register(device, VENUS_VBIF_AXI_HALT_CTRL0); reg |= VENUS_VBIF_AXI_HALT_CTRL0_HALT_REQ; __write_register(device, VENUS_VBIF_AXI_HALT_CTRL0, reg); /* Request for AXI bus port halt */ rc = readl_poll_timeout(device->hal_data->register_base + VENUS_VBIF_AXI_HALT_CTRL1, reg, reg & VENUS_VBIF_AXI_HALT_CTRL1_HALT_ACK, POLL_INTERVAL_US, VENUS_VBIF_AXI_HALT_ACK_TIMEOUT_US); if (rc) dprintk(VIDC_WARN, "AXI bus port halt timeout\n"); return rc; } static int __set_clocks(struct venus_hfi_device *device, u32 freq) static int __set_clocks(struct venus_hfi_device *device, u32 freq) { { struct clock_info *cl; struct clock_info *cl; Loading Loading @@ -2981,15 +2943,6 @@ static void __process_sys_error(struct venus_hfi_device *device) __set_state(device, VENUS_STATE_DEINIT); __set_state(device, VENUS_STATE_DEINIT); /* * Once SYS_ERROR received from HW, it is safe to halt the AXI. * With SYS_ERROR, Venus FW may have crashed and HW might be * active and causing unnecessary transactions. Hence it is * safe to stop all AXI transactions from venus sub-system. */ if (__halt_axi(device)) dprintk(VIDC_WARN, "Failed to halt AXI after SYS_ERROR\n"); vsfr = (struct hfi_sfr_struct *)device->sfr.align_virtual_addr; vsfr = (struct hfi_sfr_struct *)device->sfr.align_virtual_addr; if (vsfr) { if (vsfr) { void *p = memchr(vsfr->rg_data, '\0', vsfr->bufSize); void *p = memchr(vsfr->rg_data, '\0', vsfr->bufSize); Loading Loading @@ -3897,7 +3850,7 @@ static int __venus_power_on(struct venus_hfi_device *device) return rc; return rc; } } static void __venus_power_off(struct venus_hfi_device *device, bool halt_axi) static void __venus_power_off(struct venus_hfi_device *device) { { if (!device->power_enabled) if (!device->power_enabled) return; return; Loading @@ -3906,12 +3859,6 @@ static void __venus_power_off(struct venus_hfi_device *device, bool halt_axi) disable_irq_nosync(device->hal_data->irq); disable_irq_nosync(device->hal_data->irq); device->intr_status = 0; device->intr_status = 0; /* Halt the AXI to make sure there are no pending transactions. * Clocks should be unprepared after making sure axi is halted. */ if (halt_axi && __halt_axi(device)) dprintk(VIDC_WARN, "Failed to halt AXI\n"); __disable_unprepare_clks(device); __disable_unprepare_clks(device); if (__disable_regulators(device)) if (__disable_regulators(device)) dprintk(VIDC_WARN, "Failed to disable regulators\n"); dprintk(VIDC_WARN, "Failed to disable regulators\n"); Loading Loading @@ -3947,7 +3894,7 @@ static inline int __suspend(struct venus_hfi_device *device) goto err_tzbsp_suspend; goto err_tzbsp_suspend; } } __venus_power_off(device, true); __venus_power_off(device); dprintk(VIDC_PROF, "Venus power collapsed\n"); dprintk(VIDC_PROF, "Venus power collapsed\n"); return rc; return rc; Loading Loading @@ -4013,7 +3960,7 @@ static inline int __resume(struct venus_hfi_device *device) err_reset_core: err_reset_core: __tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); __tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); err_set_video_state: err_set_video_state: __venus_power_off(device, true); __venus_power_off(device); err_venus_power_on: err_venus_power_on: dprintk(VIDC_ERR, "Failed to resume from power collapse\n"); dprintk(VIDC_ERR, "Failed to resume from power collapse\n"); return rc; return rc; Loading Loading @@ -4072,7 +4019,7 @@ static int __load_fw(struct venus_hfi_device *device) subsystem_put(device->resources.fw.cookie); subsystem_put(device->resources.fw.cookie); device->resources.fw.cookie = NULL; device->resources.fw.cookie = NULL; fail_load_fw: fail_load_fw: __venus_power_off(device, true); __venus_power_off(device); fail_venus_power_on: fail_venus_power_on: fail_init_pkt: fail_init_pkt: __deinit_resources(device); __deinit_resources(device); Loading @@ -4093,7 +4040,7 @@ static void __unload_fw(struct venus_hfi_device *device) __vote_buses(device, NULL, 0); __vote_buses(device, NULL, 0); subsystem_put(device->resources.fw.cookie); subsystem_put(device->resources.fw.cookie); __interface_queues_release(device); __interface_queues_release(device); __venus_power_off(device, false); __venus_power_off(device); device->resources.fw.cookie = NULL; device->resources.fw.cookie = NULL; __deinit_resources(device); __deinit_resources(device); } } Loading Loading
drivers/media/platform/msm/vidc/venus_hfi.c +5 −58 Original line number Original line Diff line number Diff line Loading @@ -1195,44 +1195,6 @@ static enum hal_default_properties venus_hfi_get_default_properties(void *dev) return prop; return prop; } } static int __halt_axi(struct venus_hfi_device *device) { u32 reg; int rc = 0; if (!device) { dprintk(VIDC_ERR, "Invalid input: %pK\n", device); return -EINVAL; } /* * Driver needs to make sure that clocks are enabled to read Venus AXI * registers. If not skip AXI HALT. */ if (!device->power_enabled) { dprintk(VIDC_WARN, "Clocks are OFF, skipping AXI HALT\n"); WARN_ON(1); return -EINVAL; } /* Halt AXI and AXI IMEM VBIF Access */ reg = __read_register(device, VENUS_VBIF_AXI_HALT_CTRL0); reg |= VENUS_VBIF_AXI_HALT_CTRL0_HALT_REQ; __write_register(device, VENUS_VBIF_AXI_HALT_CTRL0, reg); /* Request for AXI bus port halt */ rc = readl_poll_timeout(device->hal_data->register_base + VENUS_VBIF_AXI_HALT_CTRL1, reg, reg & VENUS_VBIF_AXI_HALT_CTRL1_HALT_ACK, POLL_INTERVAL_US, VENUS_VBIF_AXI_HALT_ACK_TIMEOUT_US); if (rc) dprintk(VIDC_WARN, "AXI bus port halt timeout\n"); return rc; } static int __set_clocks(struct venus_hfi_device *device, u32 freq) static int __set_clocks(struct venus_hfi_device *device, u32 freq) { { struct clock_info *cl; struct clock_info *cl; Loading Loading @@ -2981,15 +2943,6 @@ static void __process_sys_error(struct venus_hfi_device *device) __set_state(device, VENUS_STATE_DEINIT); __set_state(device, VENUS_STATE_DEINIT); /* * Once SYS_ERROR received from HW, it is safe to halt the AXI. * With SYS_ERROR, Venus FW may have crashed and HW might be * active and causing unnecessary transactions. Hence it is * safe to stop all AXI transactions from venus sub-system. */ if (__halt_axi(device)) dprintk(VIDC_WARN, "Failed to halt AXI after SYS_ERROR\n"); vsfr = (struct hfi_sfr_struct *)device->sfr.align_virtual_addr; vsfr = (struct hfi_sfr_struct *)device->sfr.align_virtual_addr; if (vsfr) { if (vsfr) { void *p = memchr(vsfr->rg_data, '\0', vsfr->bufSize); void *p = memchr(vsfr->rg_data, '\0', vsfr->bufSize); Loading Loading @@ -3897,7 +3850,7 @@ static int __venus_power_on(struct venus_hfi_device *device) return rc; return rc; } } static void __venus_power_off(struct venus_hfi_device *device, bool halt_axi) static void __venus_power_off(struct venus_hfi_device *device) { { if (!device->power_enabled) if (!device->power_enabled) return; return; Loading @@ -3906,12 +3859,6 @@ static void __venus_power_off(struct venus_hfi_device *device, bool halt_axi) disable_irq_nosync(device->hal_data->irq); disable_irq_nosync(device->hal_data->irq); device->intr_status = 0; device->intr_status = 0; /* Halt the AXI to make sure there are no pending transactions. * Clocks should be unprepared after making sure axi is halted. */ if (halt_axi && __halt_axi(device)) dprintk(VIDC_WARN, "Failed to halt AXI\n"); __disable_unprepare_clks(device); __disable_unprepare_clks(device); if (__disable_regulators(device)) if (__disable_regulators(device)) dprintk(VIDC_WARN, "Failed to disable regulators\n"); dprintk(VIDC_WARN, "Failed to disable regulators\n"); Loading Loading @@ -3947,7 +3894,7 @@ static inline int __suspend(struct venus_hfi_device *device) goto err_tzbsp_suspend; goto err_tzbsp_suspend; } } __venus_power_off(device, true); __venus_power_off(device); dprintk(VIDC_PROF, "Venus power collapsed\n"); dprintk(VIDC_PROF, "Venus power collapsed\n"); return rc; return rc; Loading Loading @@ -4013,7 +3960,7 @@ static inline int __resume(struct venus_hfi_device *device) err_reset_core: err_reset_core: __tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); __tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); err_set_video_state: err_set_video_state: __venus_power_off(device, true); __venus_power_off(device); err_venus_power_on: err_venus_power_on: dprintk(VIDC_ERR, "Failed to resume from power collapse\n"); dprintk(VIDC_ERR, "Failed to resume from power collapse\n"); return rc; return rc; Loading Loading @@ -4072,7 +4019,7 @@ static int __load_fw(struct venus_hfi_device *device) subsystem_put(device->resources.fw.cookie); subsystem_put(device->resources.fw.cookie); device->resources.fw.cookie = NULL; device->resources.fw.cookie = NULL; fail_load_fw: fail_load_fw: __venus_power_off(device, true); __venus_power_off(device); fail_venus_power_on: fail_venus_power_on: fail_init_pkt: fail_init_pkt: __deinit_resources(device); __deinit_resources(device); Loading @@ -4093,7 +4040,7 @@ static void __unload_fw(struct venus_hfi_device *device) __vote_buses(device, NULL, 0); __vote_buses(device, NULL, 0); subsystem_put(device->resources.fw.cookie); subsystem_put(device->resources.fw.cookie); __interface_queues_release(device); __interface_queues_release(device); __venus_power_off(device, false); __venus_power_off(device); device->resources.fw.cookie = NULL; device->resources.fw.cookie = NULL; __deinit_resources(device); __deinit_resources(device); } } Loading