* [PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error
@ 2026-09-23 7:25 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:03 ` [PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error Frank Li
0 siblings, 2 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-23 7:25 UTC (permalink / raw)
To: Vignesh Raghavendra, Vinod Koul, Frank Li
Cc: Peter Ujfalusi, Chuhong Yuan, dmaengine, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
pm_runtime_get_sync() leaves the runtime PM usage counter incremented even
when it fails, but the error path in edma_probe() does not call
pm_runtime_put_noidle() to balance it, leaking a reference each time
resume fails.
Use pm_runtime_resume_and_get() instead, which automatically drops the
usage counter on failure, fixing the leak.
Fixes: 2a03c1314506 ("dmaengine: ti: edma: add missed operations")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Update the commit message: Change the function name from netcp_probe()
to edma_probe().
drivers/dma/ti/edma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index d97db5af3555..8be9e71dab76 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -2345,9 +2345,9 @@ 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");
+ dev_err(dev, "pm_runtime_resume_and_get() failed\n");
pm_runtime_disable(dev);
return ret;
}
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] dmaengine: ti: edma: Fix missing pm_runtime cleanup on probe failure
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 ` phucduc.bui
2026-09-23 16:47 ` Frank Li
2026-09-23 16:03 ` [PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error Frank Li
1 sibling, 1 reply; 4+ messages in thread
From: phucduc.bui @ 2026-09-23 7:25 UTC (permalink / raw)
To: Vignesh Raghavendra, Vinod Koul, Frank Li
Cc: Peter Ujfalusi, Chuhong Yuan, dmaengine, linux-kernel, bui duc phuc
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>
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error
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:03 ` Frank Li
1 sibling, 0 replies; 4+ messages in thread
From: Frank Li @ 2026-09-23 16:03 UTC (permalink / raw)
To: phucduc.bui
Cc: Vignesh Raghavendra, Vinod Koul, Frank Li, Peter Ujfalusi,
Chuhong Yuan, dmaengine, linux-kernel
On Wed, Sep 23, 2026 at 02:25:31PM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> pm_runtime_get_sync() leaves the runtime PM usage counter incremented even
> when it fails, but the error path in edma_probe() does not call
> pm_runtime_put_noidle() to balance it, leaking a reference each time
> resume fails.
>
> Use pm_runtime_resume_and_get() instead, which automatically drops the
> usage counter on failure, fixing the leak.
>
> Fixes: 2a03c1314506 ("dmaengine: ti: edma: add missed operations")
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Changes in v2:
> - Update the commit message: Change the function name from netcp_probe()
> to edma_probe().
>
> drivers/dma/ti/edma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index d97db5af3555..8be9e71dab76 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2345,9 +2345,9 @@ 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");
> + dev_err(dev, "pm_runtime_resume_and_get() failed\n");
> pm_runtime_disable(dev);
> return ret;
> }
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] dmaengine: ti: edma: Fix missing pm_runtime cleanup on probe failure
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
0 siblings, 0 replies; 4+ messages in thread
From: Frank Li @ 2026-09-23 16:47 UTC (permalink / raw)
To: phucduc.bui
Cc: Vignesh Raghavendra, Vinod Koul, Frank Li, Peter Ujfalusi,
Chuhong Yuan, dmaengine, linux-kernel
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-23 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2026-09-23 16:03 ` [PATCH v2 1/2] dmaengine: ti: edma: fix pm_runtime usage counter leak on error Frank Li
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®