Re: [PATCH v3 3/3] media: qcom: iris: Skip register access in IRQ handler after power-off
From: bod
Date: Tue Dec 01 2026 - 05:21:46 EST
On 2026-11-20 13:12 +0530, Vishnu Reddy wrote:
> The threaded IRQ handler reads and clears the interrupt registers
> under core->lock. Power-off disables the IRQ without waiting for a
> queued handler. If the handler is woken and queued around the same
> time power-off is entered, it runs after the VPU is powered down and
> accesses the registers of powered-off hardware.
>
> disable_irq() cannot be used to wait for the handler. The caller of
> power-off holds core->lock and blocks in disable_irq() waiting for the
> handler, while the handler blocks waiting for core->lock.
>
> Track the power state in core->powered, which power-on and power-off
> change under core->lock. The handler checks it after taking the lock
> and returns without touching the hardware when the VPU is off.
>
> Fixes: bb8a95aa038e ("media: iris: implement power management")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/platform/qcom/iris/iris_core.h | 2 ++
> drivers/media/platform/qcom/iris/iris_hfi_common.c | 6 ++++++
> drivers/media/platform/qcom/iris/iris_vpu_common.c | 2 ++
> 3 files changed, 10 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h
> index 468ccb551ec3..ca1a55bec334 100644
> --- a/drivers/media/platform/qcom/iris/iris_core.h
> +++ b/drivers/media/platform/qcom/iris/iris_core.h
> @@ -70,6 +70,7 @@ struct qcom_ubwc_cfg_data;
> * @message_queue: shared interface queue to receive responses from firmware
> * @debug_queue: shared interface queue to receive debug info from firmware
> * @lock: a lock for this strucure
> + * @powered: VPU is powered on, protected by @lock
> * @wdt_irq_disabled: IRQ was disabled by the handler on a watchdog interrupt
> * @response_packet: a pointer to response packet from fw to driver
> * @header_id: id of packet header
> @@ -117,6 +118,7 @@ struct iris_core {
> struct iris_iface_q_info message_queue;
> struct iris_iface_q_info debug_queue;
> struct mutex lock; /* lock for core related operations */
> + bool powered;
Instead of adding flags the thing to do is rework the watchdog
disable/enable/mask logic so the flags aren't necessary.
---
bod