Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH] dmaengine: fsl-edma: avoid double-disable of channel clocks
@ 2026-11-29 12:27 Jiawen Liu
  2026-11-30  2:54 ` Peng Fan (OSS)
  2026-11-30 20:40 ` Frank Li
  0 siblings, 2 replies; 3+ messages in thread
From: Jiawen Liu @ 2026-11-29 12:27 UTC (permalink / raw)
  To: Frank Li, Vinod Koul; +Cc: imx, dmaengine, linux-kernel

devm_clk_get_enabled() registers automatic clock cleanup for each
i.MX8ULP eDMA channel. The probe also manually disables the clock after
channel initialization, so devres teardown executes disable and
unprepare for the same enable a second time.

Obtain the clock with devm_clk_get(), enable it explicitly for channel
initialization, and retain the existing manual disable. Propagate an
enable failure before touching the channel registers.

Fixes: d8d4355861d8 ("dmaengine: fsl-edma: add i.MX8ULP edma support")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
 drivers/dma/fsl-edma-main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
index da51399114884..ecbd5b597d8d9 100644
--- a/drivers/dma/fsl-edma-main.c
+++ b/drivers/dma/fsl-edma-main.c
@@ -815,11 +815,15 @@ static int fsl_edma_probe(struct platform_device *pdev)
 
 		if (drvdata->flags & FSL_EDMA_DRV_HAS_CHCLK) {
 			snprintf(clk_name, sizeof(clk_name), "ch%02d", i);
-			fsl_chan->clk = devm_clk_get_enabled(&pdev->dev,
-							     (const char *)clk_name);
+			fsl_chan->clk = devm_clk_get(&pdev->dev, clk_name);
 
 			if (IS_ERR(fsl_chan->clk))
 				return PTR_ERR(fsl_chan->clk);
+
+			ret = clk_prepare_enable(fsl_chan->clk);
+			if (ret)
+				return dev_err_probe(&pdev->dev, ret,
+						     "Failed to enable channel clock\n");
 		}
 		fsl_chan->pdev = pdev;
 		vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev);
-- 
2.34.1


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

end of thread, other threads:[~2026-11-30 20:40 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:27 [PATCH] dmaengine: fsl-edma: avoid double-disable of channel clocks Jiawen Liu
2026-11-30  2:54 ` Peng Fan (OSS)
2026-11-30 20:40 ` Frank Li

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