Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: fsl-edma: kill the tasklets upon exit

drivers should ensure that tasklets are killed, so that they can't be
executed after driver remove is executed, so ensure they are killed.

This driver used vchan tasklets, so those need to be killed.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Cc: Jingchang Lu <b35083@freescale.com>
Cc: Peter Griffin <peter.griffin@linaro.org>

+12
+12
drivers/dma/fsl-edma.c
··· 995 995 return 0; 996 996 } 997 997 998 + static void fsl_edma_cleanup_vchan(struct dma_device *dmadev) 999 + { 1000 + struct fsl_edma_chan *chan, *_chan; 1001 + 1002 + list_for_each_entry_safe(chan, _chan, 1003 + &dmadev->channels, vchan.chan.device_node) { 1004 + list_del(&chan->vchan.chan.device_node); 1005 + tasklet_kill(&chan->vchan.task); 1006 + } 1007 + } 1008 + 998 1009 static int fsl_edma_remove(struct platform_device *pdev) 999 1010 { 1000 1011 struct device_node *np = pdev->dev.of_node; 1001 1012 struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev); 1002 1013 1003 1014 fsl_edma_irq_exit(pdev, fsl_edma); 1015 + fsl_edma_cleanup_vchan(&fsl_edma->dma_dev); 1004 1016 of_dma_controller_free(np); 1005 1017 dma_async_device_unregister(&fsl_edma->dma_dev); 1006 1018 fsl_disable_clocks(fsl_edma);