dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: ti: edma: Fix runtime PM imbalance on error
@ 2020-05-21  8:46 Dinghao Liu
  2020-05-25  8:40 ` Peter Ujfalusi
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-05-21  8:46 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Vinod Koul, Dan Williams, Peter Ujfalusi, Chuhong Yuan,
	Arnd Bergmann, Colin Ian King, YueHaibing, dmaengine,
	linux-kernel

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/dma/ti/edma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index c4a5c170c1f9..609ce2607eb7 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -2402,8 +2402,7 @@ static int edma_probe(struct platform_device *pdev)
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
 		dev_err(dev, "pm_runtime_get_sync() failed\n");
-		pm_runtime_disable(dev);
-		return ret;
+		goto err_disable_pm;
 	}
 
 	/* Get eDMA3 configuration from IP */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: ti: edma: Fix runtime PM imbalance on error
  2020-05-21  8:46 [PATCH] dmaengine: ti: edma: Fix runtime PM imbalance on error Dinghao Liu
@ 2020-05-25  8:40 ` Peter Ujfalusi
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Ujfalusi @ 2020-05-25  8:40 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: Vinod Koul, Dan Williams, Chuhong Yuan, Arnd Bergmann,
	Colin Ian King, YueHaibing, dmaengine, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]



On 21/05/2020 11.46, Dinghao Liu wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> when it returns an error code. Thus a pairing decrement is needed on
> the error handling path to keep the counter balanced.

Thank you for the patch!

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/dma/ti/edma.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index c4a5c170c1f9..609ce2607eb7 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2402,8 +2402,7 @@ static int edma_probe(struct platform_device *pdev)
>  	ret = pm_runtime_get_sync(dev);
>  	if (ret < 0) {
>  		dev_err(dev, "pm_runtime_get_sync() failed\n");
> -		pm_runtime_disable(dev);
> -		return ret;
> +		goto err_disable_pm;
>  	}
>  
>  	/* Get eDMA3 configuration from IP */
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1783 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-25  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21  8:46 [PATCH] dmaengine: ti: edma: Fix runtime PM imbalance on error Dinghao Liu
2020-05-25  8:40 ` Peter Ujfalusi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).