[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200522053154.5951-1-dinghao.liu@zju.edu.cn>
Date: Fri, 22 May 2020 13:31:53 +0800
From: Dinghao Liu <dinghao.liu@....edu.cn>
To: dinghao.liu@....edu.cn, kjlu@....edu
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>,
Dan Williams <dan.j.williams@...el.com>,
Vinod Koul <vkoul@...nel.org>, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] dmaengine: dw-axi-dmac: Fix runtime PM imbalance on error
When axi_dma_resume() returns an error code, a pairing
runtime PM usage counter decrement is needed to keep the
counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
---
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 14c1ac26f866..a368d01170f1 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -924,8 +924,10 @@ static int dw_probe(struct platform_device *pdev)
*/
pm_runtime_get_noresume(chip->dev);
ret = axi_dma_resume(chip);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put(chip->dev);
goto err_pm_disable;
+ }
axi_dma_hw_init(chip);
--
2.17.1
Powered by blists - more mailing lists