* [PATCH] dmaengine: stm32-dmamux: don't resume runtime PM under a spinlock
@ 2026-11-18 8:28 Hyunjung Ko
0 siblings, 0 replies; only message in thread
From: Hyunjung Ko @ 2026-11-18 8:28 UTC (permalink / raw)
To: Amélie Delaunay, Vinod Koul, Frank Li
Cc: Maxime Coquelin, Alexandre Torgue, dmaengine, linux-stm32,
linux-arm-kernel, linux-kernel, stable, Hyunjung Ko
stm32_dmamux_route_allocate() calls pm_runtime_resume_and_get() while
holding dmamux->lock with interrupts disabled. The runtime-resume
callback stm32_dmamux_runtime_resume() calls clk_prepare_enable(), which
can sleep, and the device is not marked pm_runtime_irq_safe(), so this
can sleep in atomic context.
The lock does not protect anything here: the dma_inuse bitmap is already
updated under the lock earlier in the function, and this second critical
section only wraps the pm_runtime call. Drop the lock around it.
Fixes: 4f3ceca254e0 ("dmaengine: stm32-dmamux: Add PM Runtime support")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
---
drivers/dma/stm32/stm32-dmamux.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/dma/stm32/stm32-dmamux.c b/drivers/dma/stm32/stm32-dmamux.c
index 57318715d9f3..890328b3d302 100644
--- a/drivers/dma/stm32/stm32-dmamux.c
+++ b/drivers/dma/stm32/stm32-dmamux.c
@@ -139,13 +139,9 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
}
/* Set dma request */
- spin_lock_irqsave(&dmamux->lock, flags);
ret = pm_runtime_resume_and_get(&pdev->dev);
- if (ret < 0) {
- spin_unlock_irqrestore(&dmamux->lock, flags);
+ if (ret < 0)
goto err_put_dma_spec_np;
- }
- spin_unlock_irqrestore(&dmamux->lock, flags);
mux->request = dma_spec->args[0];
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-18 8:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 8:28 [PATCH] dmaengine: stm32-dmamux: don't resume runtime PM under a spinlock Hyunjung Ko
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®