Skip to content

Commit 6f93b93

Browse files
author
Vinod Koul
committed
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>
1 parent cec9cfa commit 6f93b93

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/dma/fsl-edma.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,12 +995,24 @@ static int fsl_edma_probe(struct platform_device *pdev)
995995
return 0;
996996
}
997997

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+
9981009
static int fsl_edma_remove(struct platform_device *pdev)
9991010
{
10001011
struct device_node *np = pdev->dev.of_node;
10011012
struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev);
10021013

10031014
fsl_edma_irq_exit(pdev, fsl_edma);
1015+
fsl_edma_cleanup_vchan(&fsl_edma->dma_dev);
10041016
of_dma_controller_free(np);
10051017
dma_async_device_unregister(&fsl_edma->dma_dev);
10061018
fsl_disable_clocks(fsl_edma);

0 commit comments

Comments
 (0)