Re: [PATCH] dmaengine: dw-axi-dmac: fix clock imbalance in resume error path
Frank Li <[email protected]>
| Newsgroups | org.kernel.vger.dmaengine,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <an3y4lS-ZE4CdJ7R@SMW015318> |
On Thu, Aug 13, 2026 at 10:54:32AM +0000, Chaithanya Lagisetty wrote: > [You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > 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 <[email protected]> > --- > 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; > + } convert driver by use clk bulk API. Frank > > axi_dma_enable(chip); > axi_dma_irq_enable(chip); > -- > 2.43.0 >