Re: [PATCH 1/7] dmaengine: ep93xx: drain tasklet before freeing channel resources
From: Frank Li
Date: Fri Nov 13 2026 - 15:39:07 EST
On Sun, Oct 18, 2026 at 12:07:17PM +0800, Jiale Yao wrote:
> The DMA interrupt handler can schedule the channel tasklet. Releasing
> the IRQ waits for a running interrupt handler, but it does not drain a
> tasklet that was already queued.
>
> The channel resource release path frees the software descriptors and
> disables the clock while such a tasklet can still access the channel and
> invoke a completion callback.
>
> Free the IRQ first to stop new tasklet producers, then kill the tasklet
> before releasing the descriptors and clock.
>
> Fixes: 5fa29a17fabf ("dmaengine: add ep93xx DMA support")
> Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> drivers/dma/ep93xx_dma.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index 311e55a97ba9..6134e9ca699d 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -1015,11 +1015,13 @@ static void ep93xx_dma_free_chan_resources(struct dma_chan *chan)
> list_splice_init(&edmac->free_list, &list);
> spin_unlock_irqrestore(&edmac->lock, flags);
>
> + free_irq(edmac->irq, edmac);
> + tasklet_kill(&edmac->tasklet);
> +
> list_for_each_entry_safe(desc, d, &list, node)
> kfree(desc);
>
> clk_disable_unprepare(edmac->clk);
> - free_irq(edmac->irq, edmac);
> }
>
> /**
> --
> 2.34.1
>