[PATCH v2 0/3] media: qcom: iris: Fix IRQ synchronization during power-off
From: Vishnu Reddy
Date: Wed Nov 11 2026 - 04:17:21 EST
Commit b9c2215bdedc9c ("media: qcom: iris: use disable_irq() during
power-off") changed the VPU power-off sequence to use disable_irq()
instead of disable_irq_nosync(). This was intended to wait for any
queued threaded IRQ handler to finish before gating VPU power.
However, iris_vpu_power_off() is called with core->lock held, and the
threaded IRQ handler (iris_hfi_isr_handler()) takes this same lock as
its first action. If the handler is queued when power-off begins,
disable_irq() blocks waiting for the handler, while the handler blocks
waiting for core->lock. This results in a deadlock.
This series reverts the commit that introduced the deadlock and
reintroduces the hardware protection safely.
The fix drops core->lock before calling disable_irq(), allowing the
pending ISR to acquire the lock and run to completion. To prevent race
conditions from concurrent power-off callers during this unlocked
window, an irq_disabling flag and a waitqueue are introduced to
serialize operations. Finally, disable_irq() is called before the
hardware is powered down, ensuring a safe hardware state.
Signed-off-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Added new patch to handle the irq depth
- Link to v1: https://patch.msgid.link/20261007-fix-disable-irq-safely-v1-0-45746f9a92de@xxxxxxxxxxxxxxxx
---
Vishnu Reddy (3):
Revert "media: qcom: iris: use disable_irq() during power-off"
media: qcom: iris: Wait for threaded IRQ completion during power-off
media: qcom: iris: Fix IRQ disable depth imbalance on watchdog interrupt
drivers/media/platform/qcom/iris/iris_core.c | 10 +++++-----
drivers/media/platform/qcom/iris/iris_core.h | 7 +++++++
drivers/media/platform/qcom/iris/iris_hfi_common.c | 6 +++++-
drivers/media/platform/qcom/iris/iris_probe.c | 9 +++++----
drivers/media/platform/qcom/iris/iris_resources.c | 16 ++++++++++++++++
drivers/media/platform/qcom/iris/iris_resources.h | 2 ++
drivers/media/platform/qcom/iris/iris_vpu_common.c | 19 ++++++++++++++++---
7 files changed, 56 insertions(+), 13 deletions(-)
---
base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
change-id: 20261004-fix-disable-irq-safely-15b2f712800b
Best regards,
--
Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>