Skip to contentSkip to conversation

FAILED: patch "[PATCH] dmaengine: fsl-edma: Fix clk leak on alloc_chan_resources" failed to apply to 6.6-stable tree

PATCH [email protected] 1 participant 1 message Jan 20

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x b18cd8b210417f90537d914ffb96e390c85a7379
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026012043-skeleton-eccentric-7e26@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From b18cd8b210417f90537d914ffb96e390c85a7379 Mon Sep 17 00:00:00 2001
From: Zhen Ni <[email protected]>
Date: Tue, 14 Oct 2025 17:05:22 +0800
Subject: [PATCH] dmaengine: fsl-edma: Fix clk leak on alloc_chan_resources
failure

When fsl_edma_alloc_chan_resources() fails after clk_prepare_enable(), the error paths only free IRQs and destroy the TCD pool, but forget to call clk_disable_unprepare(). This causes the channel clock to remain enabled, leaking power and resources.

Fix it by disabling the channel clock in the error unwind path.

Fixes d8d4355861d8 ("dmaengine: fsl-edma: add i.MX8ULP edma support")
drivers/dma/fsl-edma-common.c +1 -0
index a59212758029..7137f51ff6a0 100644
@@ -873,6 +873,7 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan)
 		free_irq(fsl_chan->txirq, fsl_chan);
 err_txirq:
 	dma_pool_destroy(fsl_chan->tcd_pool);
+	clk_disable_unprepare(fsl_chan->clk);
 
 	return ret;
 }