public inbox for dmaengine@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Wang Xiaojun <wangxiaojun11@huawei.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org
Subject: Re: [PATCH] dmaengine: ti: edma: Fix reference count leaks due to pm_runtime_get_sync
Date: Tue, 24 Nov 2020 22:54:21 +0530	[thread overview]
Message-ID: <20201124172421.GV8403@vkoul-mobl> (raw)
In-Reply-To: <20201123135928.2702845-1-wangxiaojun11@huawei.com>

On 23-11-20, 21:59, Wang Xiaojun wrote:
> On calling pm_runtime_get_sync() the reference count of the device
> is incremented. In case of failure, should decrement the reference
> count before returning the error. So we fixed it by replacing it
> with pm_runtime_resume_and_get.

Peter?

> 
> Signed-off-by: Wang Xiaojun <wangxiaojun11@huawei.com>
> ---
>  drivers/dma/ti/edma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index 35d81bd857f1..38af8b596e1c 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2399,7 +2399,7 @@ static int edma_probe(struct platform_device *pdev)
>  	platform_set_drvdata(pdev, ecc);
>  
>  	pm_runtime_enable(dev);
> -	ret = pm_runtime_get_sync(dev);
> +	ret = pm_runtime_resume_and_get(dev);
>  	if (ret < 0) {
>  		dev_err(dev, "pm_runtime_get_sync() failed\n");
>  		pm_runtime_disable(dev);
> -- 
> 2.25.1

-- 
~Vinod

  reply	other threads:[~2020-11-24 17:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 13:59 [PATCH] dmaengine: ti: edma: Fix reference count leaks due to pm_runtime_get_sync Wang Xiaojun
2020-11-24 17:24 ` Vinod Koul [this message]
2020-11-25  6:36   ` Peter Ujfalusi
2020-12-11 13:35     ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201124172421.GV8403@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=wangxiaojun11@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox