Re: [PATCH v4] media: qcom: iris: guard IRQ handler with runtime PM check

From: Konrad Dybcio

Date: Mon Jun 08 2026 - 03:54:50 EST


On 6/8/26 2:11 AM, Hungyu Lin wrote:
> Guard hardware register access in the threaded IRQ handler with
> pm_runtime_get_if_active().
>
> A possible ordering exists where the top-half IRQ handler returns
> IRQ_WAKE_THREAD, runtime PM suspend powers down the VPU, and the
> threaded IRQ handler subsequently runs and accesses hardware
> registers through iris_vpu_clear_interrupt().
>
> Avoid touching registers when the device is no longer active by
> skipping interrupt processing when runtime PM indicates that the
> device is suspended.
>
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> ---

[...]

> --- a/drivers/media/platform/qcom/iris/iris_hfi_common.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.c
> @@ -100,10 +100,17 @@ irqreturn_t iris_hfi_isr(int irq, void *data)
> irqreturn_t iris_hfi_isr_handler(int irq, void *data)
> {
> struct iris_core *core = data;
> + int ret;
>
> if (!core)
> return IRQ_NONE;
>
> + if (IS_ENABLED(CONFIG_PM)) {

I'm not sure this driver is much useful without CONFIG_PM

> + ret = pm_runtime_get_if_active(core->dev);
> + if (ret <= 0)
> + return IRQ_NONE;
> + }

Have you actually hit this issue, or is it purely theoretical? We
shouldn't be receiving interrupts at the tail end of suspend callbacks
(and there's a disable_irq_nosync() right after the HW is disabled)

Konrad