mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dmaengine: dw-axi-dmac: fix clock imbalance in resume error path
@ 2026-08-13 10:54 Chaithanya Lagisetty
  2026-08-13 16:37 ` Frank Li
  0 siblings, 1 reply; 6+ messages in thread
From: Chaithanya Lagisetty @ 2026-08-13 10:54 UTC (permalink / raw)
  To: Eugeniy Paltsev, Vinod Koul
  Cc: Frank Li, Chaithanya Lagisetty, dmaengine, linux-kernel

axi_dma_resume() enables cfgr_clk and then core_clk. If enabling
core_clk fails, the function returns the error without disabling
cfgr_clk, which was already enabled, leaving the clock refcount
unbalanced.

Disable cfgr_clk on the core_clk enable failure path.

Fixes: 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver")
Signed-off-by: Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
---
 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 bcefaff03b5c..9db8993e0bc6 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1335,8 +1335,10 @@ static int axi_dma_resume(struct axi_dma_chip *chip)
 		return ret;
 
 	ret = clk_prepare_enable(chip->core_clk);
-	if (ret < 0)
+	if (ret < 0) {
+		clk_disable_unprepare(chip->cfgr_clk);
 		return ret;
+	}
 
 	axi_dma_enable(chip);
 	axi_dma_irq_enable(chip);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-03 17:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13 10:54 [PATCH] dmaengine: dw-axi-dmac: fix clock imbalance in resume error path Chaithanya Lagisetty
2026-08-13 16:37 ` Frank Li
2026-08-16  5:48   ` [PATCH v2] dmaengine: dw-axi-dmac: convert clock handling to clk_bulk API Chaithanya Lagisetty
2026-08-19 19:22     ` Frank Li
     [not found]       ` <CALFZYQUrxNp3W2WvL0oWWEKUFxKnLyfbYyOzE3aNBWWG-pf0kQ@mail.gmail.com>
2026-09-03 16:08         ` Vinod Koul
2026-09-03 17:05     ` Vinod Koul

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®