Re: [PATCH] dmaengine: fsl-edma: avoid double-disable of channel clocks
From: Frank Li
Date: Mon Nov 30 2026 - 15:40:58 EST
On Sun, Nov 29, 2026 at 04:27:15PM +0400, Jiawen Liu wrote:
> 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@xxxxxx>
> ---
I hope use Joy's patch
https://patchwork.kernel.org/project/linux-dmaengine/patch/20261125-b4-edma-runtime-opt-mo-v8-1-81345a3bfb52@xxxxxxxxxxx/
to fix these propblem
Frank
> 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
>
>