[PATCH] dmaengine: stm32-dma: Fix runtime PM reference leak in pm_suspend

Amelie Delaunay amelie.delaunay at foss.st.com
Mon Nov 2 02:45:22 PST 2026


On 11/2/26 11:41, Xiangwu Lai wrote:
> stm32_dma_pm_suspend() increments the runtime PM usage counter with
> pm_runtime_resume_and_get(), but when a channel is still enabled it
> returns -EBUSY directly without dropping the reference.  The matching
> pm_runtime_put_sync() only runs on the success path.
> 
> Each failed suspend attempt therefore leaks one runtime PM reference,
> so the device can never runtime suspend afterwards.  Drop the
> reference before returning -EBUSY.
> 
> Fixes: 05f8740a0e6f ("dmaengine: stm32-dma: add suspend/resume power management support")
> Signed-off-by: Xiangwu Lai <laixiangwu at cmss.chinamobile.com>

Thanks for your patch,
Reviewed-by: Amelie Delaunay <amelie.delaunay at 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 d3ad78562..2abe846a9 100644
> --- a/drivers/dma/stm32/stm32-dma.c
> +++ b/drivers/dma/stm32/stm32-dma.c
> @@ -1743,6 +1743,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;
>   		}
>   	}
> 
> 




More information about the linux-arm-kernel mailing list