[PATCH] maengine: ste_dma40: Fix PM disable depth imbalance in d40_probe

Zhang Shurong posted 1 patch 2 years, 2 months ago
drivers/dma/ste_dma40.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] maengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
Posted by Zhang Shurong 2 years, 2 months ago
The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context.
We fix it by calling pm_runtime_disable when error returns.

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
---
 drivers/dma/ste_dma40.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 89e82508c133..002833fb1fa0 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3668,6 +3668,7 @@ static int __init d40_probe(struct platform_device *pdev)
 		regulator_disable(base->lcpa_regulator);
 		regulator_put(base->lcpa_regulator);
 	}
+	pm_runtime_disable(base->dev);
 
  report_failure:
 	d40_err(dev, "probe failed\n");
-- 
2.30.2
Re: [PATCH] maengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
Posted by Vinod Koul 2 years, 2 months ago
On Thu, 05 Oct 2023 22:28:35 +0800, Zhang Shurong wrote:
> The pm_runtime_enable will increase power disable depth. Thus
> a pairing decrement is needed on the error handling path to
> keep it balanced according to context.
> We fix it by calling pm_runtime_disable when error returns.
> 
> 

Applied, thanks!

[1/1] maengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
      commit: 0618c077a8c20e8c81e367988f70f7e32bb5a717

Best regards,
-- 
~Vinod
Re: [PATCH] maengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
Posted by Linus Walleij 2 years, 2 months ago
On Thu, Oct 5, 2023 at 4:28 PM Zhang Shurong <zhang_shurong@foxmail.com> wrote:

> The pm_runtime_enable will increase power disable depth. Thus
> a pairing decrement is needed on the error handling path to
> keep it balanced according to context.
> We fix it by calling pm_runtime_disable when error returns.
>
> Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>

Looks correct,
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij