DMA Engine development
 help / color / mirror / Atom feed
* [PATCH] dmaengine: jz4780: handle clock enable failures
@ 2026-11-29 12:53 Jiawen Liu
  2026-11-29 14:50 ` H. Nikolaus Schaller
  2026-11-29 19:10 ` Markus Elfring
  0 siblings, 2 replies; 3+ messages in thread
From: Jiawen Liu @ 2026-11-29 12:53 UTC (permalink / raw)
  To: Paul Cercueil, Vinod Koul; +Cc: Frank Li, linux-mips, dmaengine, linux-kernel

jz4780_dma_probe() ignores the result of clk_prepare_enable() and
continues to configure controller registers, request resources, and
register the DMA controller. A parent-clock failure can therefore publish
a controller without a successful clock activation. Later probe cleanup
can also attempt to disable a clock that was never enabled.

Propagate the activation error before touching the controller.

Fixes: d894fc6046fe ("dmaengine: jz4780: add driver for the Ingenic JZ4780 DMA controller")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
 drivers/dma/dma-jz4780.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index e610aba094188..c1438bf3336b0 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -902,7 +902,9 @@ static int jz4780_dma_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	clk_prepare_enable(jzdma->clk);
+	ret = clk_prepare_enable(jzdma->clk);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to enable clock\n");
 
 	/* Property is optional, if it doesn't exist the value will remain 0. */
 	of_property_read_u32_index(dev->of_node, "ingenic,reserved-channels",
-- 
2.34.1


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

end of thread, other threads:[~2026-11-29 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 12:53 [PATCH] dmaengine: jz4780: handle clock enable failures Jiawen Liu
2026-11-29 14:50 ` H. Nikolaus Schaller
2026-11-29 19:10 ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox