[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200523134507.6882-1-dinghao.liu@zju.edu.cn>
Date: Sat, 23 May 2020 21:45:05 +0800
From: Dinghao Liu <dinghao.liu@....edu.cn>
To: dinghao.liu@....edu.cn, kjlu@....edu
Cc: Dan Williams <dan.j.williams@...el.com>,
Vinod Koul <vkoul@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Simon Horman <horms+renesas@...ge.net.au>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Baolin Wang <baolin.wang@...aro.org>,
Colin Ian King <colin.king@...onical.com>,
Stephen Boyd <swboyd@...omium.org>, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] dmaengine: rcar-dmac: Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Also, call pm_runtime_disable() when pm_runtime_get_sync() returns
an error code.
Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
---
drivers/dma/sh/rcar-dmac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 59b36ab5d684..19fe80985740 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1879,6 +1879,8 @@ static int rcar_dmac_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) {
dev_err(&pdev->dev, "runtime PM get sync failed (%d)\n", ret);
+ pm_runtime_put_noidle(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
return ret;
}
--
2.17.1
Powered by blists - more mailing lists