* [PATCH] dmaengine: stm32-dma: drop the runtime PM reference when suspend is refused
@ 2026-11-29 17:16 Cong Nguyen
2026-11-30 8:11 ` Amelie Delaunay
0 siblings, 1 reply; 2+ messages in thread
From: Cong Nguyen @ 2026-11-29 17:16 UTC (permalink / raw)
To: Amélie Delaunay, Vinod Koul
Cc: Frank Li, dmaengine, linux-stm32, linux-kernel
stm32_dma_pm_suspend() returns -EBUSY when a channel is still enabled,
without dropping the runtime PM reference it took, so the controller
stays runtime resumed.
Call pm_runtime_put_sync() before returning -EBUSY.
Fixes: 05f8740a0e6f ("dmaengine: stm32-dma: add suspend/resume power management support")
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
drivers/dma/stm32/stm32-dma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/stm32/stm32-dma.c b/drivers/dma/stm32/stm32-dma.c
index ba8121d37f51..5e1bf8cdedb3 100644
--- a/drivers/dma/stm32/stm32-dma.c
+++ b/drivers/dma/stm32/stm32-dma.c
@@ -1738,6 +1738,7 @@ static int stm32_dma_pm_suspend(struct device *dev)
scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id));
if (scr & STM32_DMA_SCR_EN) {
dev_warn(dev, "Suspend is prevented by Chan %i\n", id);
+ pm_runtime_put_sync(dev);
return -EBUSY;
}
}
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: stm32-dma: drop the runtime PM reference when suspend is refused
2026-11-29 17:16 [PATCH] dmaengine: stm32-dma: drop the runtime PM reference when suspend is refused Cong Nguyen
@ 2026-11-30 8:11 ` Amelie Delaunay
0 siblings, 0 replies; 2+ messages in thread
From: Amelie Delaunay @ 2026-11-30 8:11 UTC (permalink / raw)
To: Cong Nguyen, Vinod Koul; +Cc: Frank Li, dmaengine, linux-stm32, linux-kernel
Hi,
Thanks for your patch.
On 11/29/26 18:16, Cong Nguyen wrote:
> stm32_dma_pm_suspend() returns -EBUSY when a channel is still enabled,
> without dropping the runtime PM reference it took, so the controller
> stays runtime resumed.
>
> Call pm_runtime_put_sync() before returning -EBUSY.
>
> Fixes: 05f8740a0e6f ("dmaengine: stm32-dma: add suspend/resume power management support")
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> ---
> drivers/dma/stm32/stm32-dma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dma/stm32/stm32-dma.c b/drivers/dma/stm32/stm32-dma.c
> index ba8121d37f51..5e1bf8cdedb3 100644
> --- a/drivers/dma/stm32/stm32-dma.c
> +++ b/drivers/dma/stm32/stm32-dma.c
> @@ -1738,6 +1738,7 @@ static int stm32_dma_pm_suspend(struct device *dev)
> scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id));
> if (scr & STM32_DMA_SCR_EN) {
> dev_warn(dev, "Suspend is prevented by Chan %i\n", id);
> + pm_runtime_put_sync(dev);
> return -EBUSY;
> }
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-30 8:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 17:16 [PATCH] dmaengine: stm32-dma: drop the runtime PM reference when suspend is refused Cong Nguyen
2026-11-30 8:11 ` Amelie Delaunay
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®