Skip to content

Commit

Permalink
msm: vidc: reset axi during firmware unload
Browse files Browse the repository at this point in the history
Ensure that the V-NOC module is reset for
1 All types of system error from firmware.
2 Specific video hardware version.

Change-Id: I534cdefd11ebb9217081c2c840f332f7ed7c450d
Signed-off-by: Vikash Garodia <[email protected]>
  • Loading branch information
vgarodia committed Jul 31, 2019
1 parent b225efc commit 88502c5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/media/platform/msm/vidc/venus_hfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down

1 comment on commit 88502c5

@stefanhh0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit is not needed since the reset code is already there via commit: e8c6f4c

Please sign in to comment.