video: driver: Migrate to threaded irq
Migrate to threaded IRQ from workqueue based IRQ handling. Change-Id: I5cf2ecaa6d9b8d67698bbaf41e8d5ff77249ab1c Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
This commit is contained in:
@@ -85,8 +85,6 @@ struct msm_vidc_core {
|
||||
struct msm_vidc_mem_addr sfr;
|
||||
struct msm_vidc_mem_addr iface_q_table;
|
||||
struct msm_vidc_iface_q_info iface_queues[VIDC_IFACEQ_NUMQ];
|
||||
struct work_struct device_work;
|
||||
struct workqueue_struct *device_workq;
|
||||
struct delayed_work pm_work;
|
||||
struct workqueue_struct *pm_workq;
|
||||
struct workqueue_struct *batch_workq;
|
||||
|
@@ -58,9 +58,9 @@ int venus_hfi_trigger_ssr(struct msm_vidc_core *core, u32 type,
|
||||
int venus_hfi_scale_clocks(struct msm_vidc_inst* inst, u64 freq);
|
||||
int venus_hfi_scale_buses(struct msm_vidc_inst* inst, u64 bw_ddr, u64 bw_llcc);
|
||||
|
||||
void venus_hfi_work_handler(struct work_struct *work);
|
||||
void venus_hfi_pm_work_handler(struct work_struct *work);
|
||||
irqreturn_t venus_hfi_isr(int irq, void *data);
|
||||
irqreturn_t venus_hfi_isr_handler(int irq, void *data);
|
||||
|
||||
int __write_register_masked(struct msm_vidc_core *core,
|
||||
u32 reg, u32 value, u32 mask);
|
||||
|
@@ -64,10 +64,10 @@ static int msm_vidc_init_irq(struct msm_vidc_core *core)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rc = request_irq(dt->irq, venus_hfi_isr, IRQF_TRIGGER_HIGH,
|
||||
"msm_vidc", core);
|
||||
if (unlikely(rc)) {
|
||||
d_vpr_e("%s: request_irq failed\n", __func__);
|
||||
rc = devm_request_threaded_irq(&core->pdev->dev, dt->irq, venus_hfi_isr,
|
||||
venus_hfi_isr_handler, IRQF_TRIGGER_HIGH, "msm-vidc", core);
|
||||
if (rc) {
|
||||
d_vpr_e("%s: Failed to allocate venus IRQ\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
disable_irq_nosync(dt->irq);
|
||||
@@ -191,12 +191,8 @@ static int msm_vidc_deinitialize_core(struct msm_vidc_core *core)
|
||||
if (core->pm_workq)
|
||||
destroy_workqueue(core->pm_workq);
|
||||
|
||||
if (core->device_workq)
|
||||
destroy_workqueue(core->device_workq);
|
||||
|
||||
core->batch_workq = NULL;
|
||||
core->pm_workq = NULL;
|
||||
core->device_workq = NULL;
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -213,13 +209,6 @@ static int msm_vidc_initialize_core(struct msm_vidc_core *core)
|
||||
|
||||
msm_vidc_change_core_state(core, MSM_VIDC_CORE_DEINIT, __func__);
|
||||
|
||||
core->device_workq = create_singlethread_workqueue("device_workq");
|
||||
if (!core->device_workq) {
|
||||
d_vpr_e("%s: create device workq failed\n", __func__);
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
core->pm_workq = create_singlethread_workqueue("pm_workq");
|
||||
if (!core->pm_workq) {
|
||||
d_vpr_e("%s: create pm workq failed\n", __func__);
|
||||
@@ -254,7 +243,6 @@ static int msm_vidc_initialize_core(struct msm_vidc_core *core)
|
||||
INIT_LIST_HEAD(&core->instances);
|
||||
INIT_LIST_HEAD(&core->dangling_instances);
|
||||
|
||||
INIT_WORK(&core->device_work, venus_hfi_work_handler);
|
||||
INIT_DELAYED_WORK(&core->pm_work, venus_hfi_pm_work_handler);
|
||||
INIT_DELAYED_WORK(&core->fw_unload_work, msm_vidc_fw_unload_handler);
|
||||
INIT_WORK(&core->ssr_work, msm_vidc_ssr_handler);
|
||||
@@ -269,11 +257,8 @@ exit:
|
||||
destroy_workqueue(core->batch_workq);
|
||||
if (core->pm_workq)
|
||||
destroy_workqueue(core->pm_workq);
|
||||
if (core->device_workq)
|
||||
destroy_workqueue(core->device_workq);
|
||||
core->batch_workq = NULL;
|
||||
core->pm_workq = NULL;
|
||||
core->device_workq = NULL;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@@ -2673,24 +2673,19 @@ static int __response_handler(struct msm_vidc_core *core)
|
||||
|
||||
irqreturn_t venus_hfi_isr(int irq, void *data)
|
||||
{
|
||||
struct msm_vidc_core *core = data;
|
||||
|
||||
disable_irq_nosync(irq);
|
||||
queue_work(core->device_workq, &core->device_work);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
return IRQ_WAKE_THREAD;
|
||||
}
|
||||
|
||||
void venus_hfi_work_handler(struct work_struct *work)
|
||||
irqreturn_t venus_hfi_isr_handler(int irq, void *data)
|
||||
{
|
||||
struct msm_vidc_core *core;
|
||||
struct msm_vidc_core *core = data;
|
||||
int num_responses = 0, rc = 0;
|
||||
|
||||
d_vpr_l("%s()\n", __func__);
|
||||
core = container_of(work, struct msm_vidc_core, device_work);
|
||||
if (!core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return;
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
core_lock(core, __func__);
|
||||
@@ -2698,16 +2693,18 @@ void venus_hfi_work_handler(struct work_struct *work)
|
||||
if (rc) {
|
||||
d_vpr_e("%s: Power on failed\n", __func__);
|
||||
core_unlock(core, __func__);
|
||||
goto err_no_work;
|
||||
goto exit;
|
||||
}
|
||||
call_venus_op(core, clear_interrupt, core);
|
||||
core_unlock(core, __func__);
|
||||
|
||||
num_responses = __response_handler(core);
|
||||
|
||||
err_no_work:
|
||||
exit:
|
||||
if (!call_venus_op(core, watchdog, core, core->intr_status))
|
||||
enable_irq(core->dt->irq);
|
||||
enable_irq(irq);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
void venus_hfi_pm_work_handler(struct work_struct *work)
|
||||
|
Reference in New Issue
Block a user