dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] dmaengine: dw-axi-dmac: Fix runtime PM imbalance on error
@ 2020-05-22  5:31 Dinghao Liu
  0 siblings, 0 replies; only message in thread
From: Dinghao Liu @ 2020-05-22  5:31 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Eugeniy Paltsev, Dan Williams, Vinod Koul, dmaengine, linux-kernel

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@zju.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  5:31 [PATCH] dmaengine: dw-axi-dmac: Fix runtime PM imbalance on error Dinghao Liu

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git