Re: [PATCH v2 2/2] dmaengine: ti: edma: Fix missing pm_runtime cleanup on probe failure

From: Frank Li

Date: Wed Sep 23 2026 - 12:48:38 EST


On Wed, Sep 23, 2026 at 02:25:32PM +0700, phucduc.bui@xxxxxxxxx wrote:
> From: bui duc phuc <phucduc.bui@xxxxxxxxx>
>
> pm_runtime_get_sync() errors were not checked, so on failure the usage
> count leaked and pm_runtime_enable() was never undone, leaving
> runtime PM in a half-initialized state after a failed probe.
>
> Switch to pm_runtime_resume_and_get(), which cleans up the usage count
> internally on error, and call pm_runtime_disable() to balance the earlier
> pm_runtime_enable() on that path.
>
> Fixes: 23f49fd2ea9b ("dmaengine: edma: Remove dynamic TPTC power management feature")
> Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
> ---

Reviewed-by: Frank Li <Frank.Li@xxxxxxx>

> drivers/dma/ti/edma.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index 8be9e71dab76..5254ce7b8514 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2650,8 +2650,16 @@ static struct platform_driver edma_driver = {
>
> static int edma_tptc_probe(struct platform_device *pdev)
> {
> + int ret;
> +
> pm_runtime_enable(&pdev->dev);
> - return pm_runtime_get_sync(&pdev->dev);
> + ret = pm_runtime_resume_and_get(&pdev->dev);
> + if (ret < 0) {
> + pm_runtime_disable(&pdev->dev);
> + return ret;
> + }
> +
> + return 0;
> }
>
> static struct platform_driver edma_tptc_driver = {
> --
> 2.43.0
>