From: Frank Li <Frank.li@oss.nxp.com>
To: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
Cc: "Amélie Delaunay" <amelie.delaunay@foss.st.com>,
"Vinod Koul" <vkoul@kernel.org>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Frank Li" <Frank.Li@kernel.org>,
dmaengine@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend
Date: Mon, 2 Nov 2026 15:13:38 -0600 [thread overview]
Message-ID: <auj9Ao7t68nbn8_0@SMW015318> (raw)
In-Reply-To: <20261102104432.873-1-laixiangwu@cmss.chinamobile.com>
On Mon, Nov 02, 2026 at 06:44:31PM +0800, Xiangwu Lai wrote:
> [You don't often get email from laixiangwu@cmss.chinamobile.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> stm32_mdma_pm_suspend() increments the runtime PM usage counter with
> pm_runtime_resume_and_get(), but when a channel is still enabled it
> returns -EBUSY directly without dropping the reference. The matching
> pm_runtime_put_sync() only runs on the success path.
>
> Each failed suspend attempt therefore leaks one runtime PM reference,
> so the device can never runtime suspend afterwards. Drop the
> reference before returning -EBUSY.
>
> Fixes: 7cb819c856d9 ("dmaengine: stm32-mdma: add suspend/resume power management support")
> Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/dma/stm32/stm32-mdma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dma/stm32/stm32-mdma.c b/drivers/dma/stm32/stm32-mdma.c
> index e3bbdc9ee..fe1ff4a00 100644
> --- a/drivers/dma/stm32/stm32-mdma.c
> +++ b/drivers/dma/stm32/stm32-mdma.c
> @@ -1785,6 +1785,7 @@ static int stm32_mdma_pm_suspend(struct device *dev)
> ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(id));
> if (ccr & STM32_MDMA_CCR_EN) {
> dev_warn(dev, "Suspend is prevented by Chan %i\n", id);
> + pm_runtime_put_sync(dev);
> return -EBUSY;
> }
> }
>
>
>
prev parent reply other threads:[~2026-11-02 21:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 10:44 [PATCH] dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend Xiangwu Lai
2026-11-02 12:23 ` Amelie Delaunay
2026-11-02 21:13 ` Frank Li [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=auj9Ao7t68nbn8_0@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=amelie.delaunay@foss.st.com \
--cc=dmaengine@vger.kernel.org \
--cc=laixiangwu@cmss.chinamobile.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@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