Thread (7 messages) 7 messages, 4 authors, 2025-11-01

Re: [PATCH v2 0/3] Fix sleeping function called from invalid context

From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Date: 2025-09-05 09:15:12
Also in: dri-devel, linux-media, linux-mediatek, lkml

Il 29/08/25 11:15, Jason-JH Lin ha scritto:
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 (local)
For the entire series:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help