From: Jon Hunter <jonathanh@nvidia.com>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>, <kjlu@umn.edu>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
Vinod Koul <vkoul@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
<dmaengine@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: tegra20: Fix runtime PM imbalance in tegra_dma_issue_pending
Date: Thu, 8 Apr 2021 13:33:00 +0100 [thread overview]
Message-ID: <5699d0e9-968c-c8b0-3b0b-0416b5b48aa0@nvidia.com> (raw)
In-Reply-To: <20210408071158.12565-1-dinghao.liu@zju.edu.cn>
On 08/04/2021 08:11, Dinghao Liu wrote:
> pm_runtime_get_sync() will increase the rumtime PM counter
> even it returns an error. Thus a pairing decrement is needed
> to prevent refcount leak. Fix this by replacing this API with
> pm_runtime_resume_and_get(), which will not change the runtime
> PM counter on error.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
> drivers/dma/tegra20-apb-dma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 71827d9b0aa1..73178afaf4c2 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -723,7 +723,7 @@ static void tegra_dma_issue_pending(struct dma_chan *dc)
> goto end;
> }
> if (!tdc->busy) {
> - err = pm_runtime_get_sync(tdc->tdma->dev);
> + err = pm_runtime_resume_and_get(tdc->tdma->dev);
> if (err < 0) {
> dev_err(tdc2dev(tdc), "Failed to enable DMA\n");
> goto end;
>
Thanks! Looks like there are two instances of this that need fixing.
Cheers
Jon
--
nvpublic
next prev parent reply other threads:[~2021-04-08 12:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 7:11 Dinghao Liu
2021-04-08 12:33 ` Jon Hunter [this message]
2021-04-09 8:24 ` dinghao.liu
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=5699d0e9-968c-c8b0-3b0b-0416b5b48aa0@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=dinghao.liu@zju.edu.cn \
--cc=dmaengine@vger.kernel.org \
--cc=kjlu@umn.edu \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=vkoul@kernel.org \
/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
all inboxes | Powered by JetHome®