mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] media: qcom: iris: Fix IRQ synchronization during power-off
@ 2026-11-20  7:42 Vishnu Reddy
  2026-11-20  7:42 ` [PATCH v3 1/3] Revert "media: qcom: iris: use disable_irq() during power-off" Vishnu Reddy
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Vishnu Reddy @ 2026-11-20  7:42 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab, Konrad Dybcio,
	Dmitry Baryshkov, Hungyu Lin, Stefan Schmidt, Hans Verkuil
  Cc: Bryan O'Donoghue, linux-media, linux-arm-msm, linux-kernel,
	Vishnu Reddy, stable

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@oss.qualcomm.com>
---
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@oss.qualcomm.com

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@oss.qualcomm.com

---
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@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-25  6:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20  7:42 [PATCH v3 0/3] media: qcom: iris: Fix IRQ synchronization during power-off Vishnu Reddy
2026-11-20  7:42 ` [PATCH v3 1/3] Revert "media: qcom: iris: use disable_irq() during power-off" Vishnu Reddy
2026-11-20  7:42 ` [PATCH v3 2/3] media: qcom: iris: Fix IRQ disable depth imbalance on watchdog interrupt Vishnu Reddy
2026-11-20  7:42 ` [PATCH v3 3/3] media: qcom: iris: Skip register access in IRQ handler after power-off Vishnu Reddy
2026-11-25  6:06 ` [PATCH v3 0/3] media: qcom: iris: Fix IRQ synchronization during power-off Wangao Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®