From: Frank Li <Frank.li@oss.nxp.com>
To: phucduc.bui@gmail.com
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Chuhong Yuan <hslester96@gmail.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] dmaengine: ti: edma: Fix missing pm_runtime cleanup on probe failure
Date: Wed, 23 Sep 2026 11:47:12 -0500 [thread overview]
Message-ID: <arQCkAolgGPrVNqI@SMW015318> (raw)
In-Reply-To: <20260923072532.19307-2-phucduc.bui@gmail.com>
On Wed, Sep 23, 2026 at 02:25:32PM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> pm_runtime_get_sync() errors were not checked, so on failure the usage
> count leaked and pm_runtime_enable() was never undone, leaving
> runtime PM in a half-initialized state after a failed probe.
>
> Switch to pm_runtime_resume_and_get(), which cleans up the usage count
> internally on error, and call pm_runtime_disable() to balance the earlier
> pm_runtime_enable() on that path.
>
> Fixes: 23f49fd2ea9b ("dmaengine: edma: Remove dynamic TPTC power management feature")
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/ti/edma.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index 8be9e71dab76..5254ce7b8514 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2650,8 +2650,16 @@ static struct platform_driver edma_driver = {
>
> static int edma_tptc_probe(struct platform_device *pdev)
> {
> + int ret;
> +
> pm_runtime_enable(&pdev->dev);
> - return pm_runtime_get_sync(&pdev->dev);
> + ret = pm_runtime_resume_and_get(&pdev->dev);
> + if (ret < 0) {
> + pm_runtime_disable(&pdev->dev);
> + return ret;
> + }
> +
> + return 0;
> }
>
> static struct platform_driver edma_tptc_driver = {
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-09-23 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 7:25 [PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error phucduc.bui
2026-09-23 7:25 ` [PATCH v2 2/2] dmaengine: ti: edma: Fix missing pm_runtime cleanup on probe failure phucduc.bui
2026-09-23 16:47 ` Frank Li [this message]
2026-09-23 16:03 ` [PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error Frank Li
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=arQCkAolgGPrVNqI@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=hslester96@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=phucduc.bui@gmail.com \
--cc=vigneshr@ti.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®