summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2016-07-02 09:28:30 (GMT)
committerVinod Koul <vinod.koul@intel.com>2016-07-16 14:49:00 (GMT)
commit6f93b93b2a1bd53f1dad9f3deb4e75874db0256a (patch)
tree1afdb33605b9e307ceb262b856caf4859307c996
parentcec9cfa8d88c8b2ad0789e8441ff98c3f52b8142 (diff)
downloadlinux-6f93b93b2a1bd53f1dad9f3deb4e75874db0256a.tar.xz
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>
-rw-r--r--drivers/dma/fsl-edma.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
index d797a3c..6775f2c 100644
--- a/drivers/dma/fsl-edma.c
+++ b/drivers/dma/fsl-edma.c
@@ -995,12 +995,24 @@ static int fsl_edma_probe(struct platform_device *pdev)
return 0;
}
+static void fsl_edma_cleanup_vchan(struct dma_device *dmadev)
+{
+ struct fsl_edma_chan *chan, *_chan;
+
+ list_for_each_entry_safe(chan, _chan,
+ &dmadev->channels, vchan.chan.device_node) {
+ list_del(&chan->vchan.chan.device_node);
+ tasklet_kill(&chan->vchan.task);
+ }
+}
+
static int fsl_edma_remove(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev);
fsl_edma_irq_exit(pdev, fsl_edma);
+ fsl_edma_cleanup_vchan(&fsl_edma->dma_dev);
of_dma_controller_free(np);
dma_async_device_unregister(&fsl_edma->dma_dev);
fsl_disable_clocks(fsl_edma);