mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Fix sleeping function called from invalid context
@ 2025-08-29  9:15 Jason-JH Lin
  2025-08-29  9:15 ` [PATCH v2 1/3] mailbox: mtk-cmdq: Remove pm_runtime APIs from cmdq_mbox_send_data() Jason-JH Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jason-JH Lin @ 2025-08-29  9:15 UTC (permalink / raw)
  To: Chun-Kuang Hu, AngeloGioacchino Del Regno, Jassi Brar,
	Mauro Carvalho Chehab
  Cc: Philipp Zabel, David Airlie, Simona Vetter, Jason-JH Lin,
	Nancy Lin, Singo Chang, Paul-PL Chen, Yongqiang Niu,
	Zhenxing Qin, Xiandong Wang, Sirius Wang, Xavier Chang,
	Jarried Lin, Fei Shao, Chen-yu Tsai,
	Project_Global_Chrome_Upstream_Group, dri-devel, linux-mediatek,
	linux-kernel, linux-arm-kernel, linux-media

We found that there is a spin_lock_irqsave protection in msg_submit()
of mailbox.c and it is in the atomic context.
So when the mailbox controller driver calls pm_runtime_get_sync() in
mbox_chan_ops->send_data(), it will get this BUG report.
"BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1164"

Additionally, pm_runtime_put_autosuspend() should be invoked from the
GCE IRQ handler to ensure the hardware has actually completed its work.

To resolve these issues, remove the pm_runtime calls from
cmdq_mbox_send_data() and delegate power management responsibilities
to the client driver.
---
Changes in v2:
- Move pm_runtmie APIs from cmdq driver to client drivers.
- Move pm_runtime_put_autosuspend to GCE irq callback function.
- Link to v1: https://lore.kernel.org/r/20240614040133.24967-1-jason-jh.lin@mediatek.com
---
Jason-JH Lin (3):
  mailbox: mtk-cmdq: Remove pm_runtime APIs from cmdq_mbox_send_data()
  drm/mediatek: Add pm_runtime support for GCE power control
  media: platform: mtk-mdp3: Add pm_runtime support for GCE power
    control

 drivers/gpu/drm/mediatek/mtk_crtc.c                  |  7 +++++++
 drivers/mailbox/mtk-cmdq-mailbox.c                   | 12 +-----------
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 11 +++++++++++
 3 files changed, 19 insertions(+), 11 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-11-01 14:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-29  9:15 [PATCH v2 0/3] Fix sleeping function called from invalid context Jason-JH Lin
2025-08-29  9:15 ` [PATCH v2 1/3] mailbox: mtk-cmdq: Remove pm_runtime APIs from cmdq_mbox_send_data() Jason-JH Lin
2025-08-29  9:15 ` [PATCH v2 2/3] drm/mediatek: Add pm_runtime support for GCE power control Jason-JH Lin
2025-09-05  5:28   ` CK Hu (胡俊光)
2025-11-01 14:37   ` Chun-Kuang Hu
2025-08-29  9:16 ` [PATCH v2 3/3] media: platform: mtk-mdp3: " Jason-JH Lin
2025-09-05  9:15 ` [PATCH v2 0/3] Fix sleeping function called from invalid context AngeloGioacchino Del Regno

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®