mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] media: qcom: iris: Fix IRQ synchronization during power-off
@ 2026-10-07 11:31 Vishnu Reddy
  2026-10-07 11:31 ` [PATCH 1/2] Revert "media: qcom: iris: use disable_irq() during power-off" Vishnu Reddy
  2026-10-07 11:31 ` [PATCH 2/2] media: qcom: iris: Wait for threaded IRQ completion during power-off Vishnu Reddy
  0 siblings, 2 replies; 5+ messages in thread
From: Vishnu Reddy @ 2026-10-07 11:31 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 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@oss.qualcomm.com>
---
Vishnu Reddy (2):
      Revert "media: qcom: iris: use disable_irq() during power-off"
      media: qcom: iris: Wait for threaded IRQ completion during power-off

 drivers/media/platform/qcom/iris/iris_core.c       | 10 +++++-----
 drivers/media/platform/qcom/iris/iris_core.h       |  5 +++++
 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 | 16 +++++++++++++---
 6 files changed, 46 insertions(+), 12 deletions(-)
---
base-commit: eea3fef32a9cf36abcb5975a5a594e4135a6b026
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-10-11  6:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 11:31 [PATCH 0/2] media: qcom: iris: Fix IRQ synchronization during power-off Vishnu Reddy
2026-10-07 11:31 ` [PATCH 1/2] Revert "media: qcom: iris: use disable_irq() during power-off" Vishnu Reddy
2026-10-07 11:31 ` [PATCH 2/2] media: qcom: iris: Wait for threaded IRQ completion during power-off Vishnu Reddy
2026-10-07 17:29   ` Hungyu Lin
2026-10-11  6:39     ` Vishnu Reddy

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®