Re: [PATCH] dmaengine: sprd-dma: handle runtime PM get failure

Frank Li <[email protected]>
Newsgroups org.kernel.vger.dmaengine,org.kernel.vger.linux-kernel
Message-ID <aoSKfDed29xf-nby@SMW015318>
On Tue, Aug 18, 2026 at 04:41:24PM +0400, Jiawen Liu wrote:
> From: jiawen <[email protected]>
>
> Route failed runtime-PM acquisition through its existing cleanup path.
>
> Release and disable runtime PM before continuing with the hardware
> teardown, so an unsuccessful pm_runtime_get_sync() does not leave
> runtime PM enabled.
>
> Signed-off-by: jiawen <[email protected]>
> ---
> diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
> --- a/drivers/dma/sprd-dma.c
> +++ b/drivers/dma/sprd-dma.c
> @@ -1212,7 +1212,7 @@
>
>  	ret = pm_runtime_get_sync(&pdev->dev);

Use cleanup

	PM_RUNTIME_ACQUIRE_IF_ENABLED(&pdev->dev, pm)
	ret = PM_RUNTIME_ACQUIRE_ERR(&pm)
	if (ret)
		...

Frank


>  	if (ret < 0)
> -		goto err_rpm;
> +		goto err_register;
>
>  	ret = dma_async_device_register(&sdev->dma_dev);
>  	if (ret < 0) {
> @@ -1234,7 +1234,6 @@
>  err_register:
>  	pm_runtime_put_noidle(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
> -err_rpm:
>  	sprd_dma_disable(sdev);
>  	return ret;
>  }
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.