From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Frank Li <Frank.li@oss.nxp.com>
Cc: Wentao Liang <vulab@iscas.ac.cn>,
Frank.Li@kernel.org, dmaengine@vger.kernel.org,
geert+renesas@glider.be,
laurent.pinchart+renesas@ideasonboard.com,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
magnus.damm@gmail.com, vkoul@kernel.org, lkml@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 4/4] dmaengine: rcar-dmac: Fix runtime PM leak in error path of channel alloc
Date: Thu, 17 Sep 2026 08:21:28 +0200 [thread overview]
Message-ID: <aquG5D6mspgqjRr7@ninjato> (raw)
In-Reply-To: <aqrtPpSO-FOnUZZx@SMW015318>
[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]
On Wed, Sep 16, 2026 at 02:25:50PM -0500, Frank Li wrote:
> On Tue, Sep 15, 2026 at 03:56:02AM +0000, Wentao Liang wrote:
> > [You don't often get email from vulab@iscas.ac.cn. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
> > rcar_dmac_alloc_chan_resources() ends with
> > "return pm_runtime_get_sync(chan->device->dev);". Even when
> > pm_runtime_get_sync() fails, it leaves the device's runtime PM
> > usage count incremented, and the negative return value propagates
> > straight to the dmaengine core, which aborts the channel
> > allocation without ever calling device_free_chan_resources(). The
> > balanced pm_runtime_put() only happens later in
> > rcar_dmac_free_chan_resources(), so the reference is leaked
> > whenever resuming the device fails.
> >
> > Use pm_runtime_resume_and_get() instead, which drops the reference
> > again on failure and returns 0 on success.
> >
> > Fixes: 87244fe5abdf ("dmaengine: rcar-dmac: Add Renesas R-Car Gen2 DMA Controller (DMAC) driver")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> > ---
>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
I'll take the liberty to add this tag to the old, 100% identical patch I
am going to resend soon (together with other patches for rcar-dmac which
fell through cracks)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-09-17 6:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 3:56 Wentao Liang
2026-09-16 8:42 ` Wolfram Sang
2026-09-16 19:25 ` Frank Li
2026-09-17 6:21 ` Wolfram Sang [this message]
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=aquG5D6mspgqjRr7@ninjato \
--to=wsa+renesas@sang-engineering.com \
--cc=Frank.Li@kernel.org \
--cc=Frank.li@oss.nxp.com \
--cc=dmaengine@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=lkml@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
--cc=vulab@iscas.ac.cn \
/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®