Re: [PATCH 3/7] dmaengine: mmp_pdma: drain channel tasklets during removal

From: Frank Li

Date: Fri Nov 13 2026 - 15:41:40 EST


On Sun, Oct 18, 2026 at 12:07:19PM +0800, Jiale Yao wrote:
> PDMA interrupt handlers schedule per-channel tasklets that process
> descriptor lists, invoke callbacks and return descriptors to their
> pools. Freeing the IRQs does not drain tasklets that were already queued.
>
> After freeing all controller or channel IRQs, kill every channel tasklet
> before unregistering the DMA device and releasing its managed state.
>
> Fixes: c8acd6aa6bed ("dmaengine: mmp-pdma support")
> Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
> ---

Reviewed-by: Frank Li <Frank.Li@xxxxxxx>

> drivers/dma/mmp_pdma.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
> index ed520737882b..a371f017fc3e 100644
> --- a/drivers/dma/mmp_pdma.c
> +++ b/drivers/dma/mmp_pdma.c
> @@ -1119,6 +1119,7 @@ static void dma_do_tasklet(struct tasklet_struct *t)
> static void mmp_pdma_remove(struct platform_device *op)
> {
> struct mmp_pdma_device *pdev = platform_get_drvdata(op);
> + struct mmp_pdma_chan *chan;
> struct mmp_pdma_phy *phy;
> int i, irq = 0, irq_num = 0;
>
> @@ -1141,6 +1142,9 @@ static void mmp_pdma_remove(struct platform_device *op)
> }
> }
>
> + list_for_each_entry(chan, &pdev->device.channels, chan.device_node)
> + tasklet_kill(&chan->tasklet);
> +
> dma_async_device_unregister(&pdev->device);
> }
>
> --
> 2.34.1
>