[PATCH 4/7] dmaengine: mmp_tdma: synchronize tasklet when freeing a channel
From: Jiale Yao
Date: Sun Oct 18 2026 - 00:09:24 EST
The channel interrupt handler schedules a tasklet to invoke the transfer
completion callback. Channel resource release does not drain a tasklet
that was already queued, so a callback can run after its client state has
been released.
Disable the channel to stop the shared interrupt path from producing
more completions, release a dedicated IRQ when present, and kill the
tasklet before freeing the descriptor storage.
Fixes: c6da0ba8dfc8 ("dmaengine: mmp_tdma: add mmp tdma support")
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
drivers/dma/mmp_tdma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index ba03321eeff7..e0de0967d7e7 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -399,8 +399,10 @@ static void mmp_tdma_free_chan_resources(struct dma_chan *chan)
{
struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan);
+ mmp_tdma_disable_chan(chan);
if (tdmac->irq)
devm_free_irq(tdmac->dev, tdmac->irq, tdmac);
+ tasklet_kill(&tdmac->tasklet);
mmp_tdma_free_descriptor(tdmac);
return;
}
--
2.34.1