[PATCH v3 0/3] media: qcom: iris: Fix IRQ synchronization during power-off

From: Vishnu Reddy

Date: Fri Nov 20 2026 - 02:42:40 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 stop a queued
threaded IRQ handler from accessing the hardware after power-off.

However, iris_vpu_power_off() is called with core->lock held, and the
threaded IRQ handler (iris_hfi_isr_handler()) takes this same lock. 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 fixes
the IRQ handling around power-off. It keeps the IRQ disable depth
balanced across power-off and power-on, and makes sure a handler queued
around power-off does not access the registers of powered-off hardware.

Signed-off-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
---
Changes in v3:
- Used IRQF_ONESHOT and dropped the manual IRQ disable/enable (Bryan)
- Avoided the irq_disabling flag, waitqueue and unlock of core->lock during power-off
- Skipped the register access once the hardware is powered off
- Link to v2: https://patch.msgid.link/20261111-fix-disable-irq-safely-v2-0-8e13f68c2ef9@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: Fix IRQ disable depth imbalance on watchdog interrupt
media: qcom: iris: Skip register access in IRQ handler after power-off

drivers/media/platform/qcom/iris/iris_core.h | 4 ++++
drivers/media/platform/qcom/iris/iris_hfi_common.c | 20 ++++++++++----------
drivers/media/platform/qcom/iris/iris_hfi_common.h | 1 -
drivers/media/platform/qcom/iris/iris_probe.c | 5 +++--
drivers/media/platform/qcom/iris/iris_vpu_common.c | 9 +++++++--
5 files changed, 24 insertions(+), 15 deletions(-)
---
base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
change-id: 20261004-fix-disable-irq-safely-15b2f712800b

Best regards,
--
Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>