Re: [PATCH 2/2] media: qcom: iris: Wait for threaded IRQ completion during power-off
From: Vishnu Reddy
Date: Sun Oct 11 2026 - 02:40:32 EST
On 10/7/2026 10:59 PM, Hungyu Lin wrote:
>> + if (!iris_vpu_watchdog(core, core->intr_status))
>> + iris_vpu_disable_irq(core);
> If the IRQ thread records a watchdog after this check, while
> disable_irq() is waiting, it skips enable_irq(). The hard handler and
> helper would then have disabled the IRQ twice, but the next power-on
> only enables it once.
>
> Could the helper recheck the watchdog after disable_irq() returns and
> core->lock is reacquired, then call enable_irq() once to balance its
> extra disable in that case?
This patch is not about the IRQ disable depth. Its purpose is to make sure
the threaded handler has finished before the VPU is powered down.
Re-enabling the IRQ here, during driver shutdown or removal, could let a
watchdog interrupt fire and reschedule the sys_error_handler work, which
can lead to a use-after-free once the core is torn down.
For that reason I would prefer not to add the enable_irq() recheck in this
patch.
Regards,
Vishnu Reddy.
> If you use this approach for the watchdog fix, could you also add:
>
> Suggested-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
>
> Thanks,
> Hungyu