Re: [PATCH 6/7] dmaengine: mxs-dma: synchronize tasklet when freeing a channel
From: Frank Li
Date: Fri Nov 13 2026 - 17:17:32 EST
On Sun, Oct 18, 2026 at 12:07:22PM +0800, Jiale Yao wrote:
> The DMA interrupt handler schedules a per-channel tasklet to invoke the
> completion callback. Releasing the IRQ does not drain a tasklet that was
> already queued, so the callback can run after its client state has been
> released.
>
> Kill the tasklet after freeing the IRQ and before releasing the channel
> command storage and clock.
>
> Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28")
> Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> drivers/dma/mxs-dma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> index 7acb3d29dad3..9e85ba45f0fa 100644
> --- a/drivers/dma/mxs-dma.c
> +++ b/drivers/dma/mxs-dma.c
> @@ -442,6 +442,7 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan)
> mxs_dma_disable_chan(chan);
>
> free_irq(mxs_chan->chan_irq, mxs_dma);
> + tasklet_kill(&mxs_chan->tasklet);
>
> dma_free_coherent(mxs_dma->dma_device.dev, CCW_BLOCK_SIZE,
> mxs_chan->ccw, mxs_chan->ccw_phys);
> --
> 2.34.1
>