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

dmaengine: jz4740: 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>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>

+14
+14
drivers/dma/dma-jz4740.c
··· 573 573 return ret; 574 574 } 575 575 576 + static void jz4740_cleanup_vchan(struct dma_device *dmadev) 577 + { 578 + struct jz4740_dmaengine_chan *chan, *_chan; 579 + 580 + list_for_each_entry_safe(chan, _chan, 581 + &dmadev->channels, vchan.chan.device_node) { 582 + list_del(&chan->vchan.chan.device_node); 583 + tasklet_kill(&chan->vchan.task); 584 + } 585 + } 586 + 587 + 576 588 static int jz4740_dma_remove(struct platform_device *pdev) 577 589 { 578 590 struct jz4740_dma_dev *dmadev = platform_get_drvdata(pdev); 579 591 int irq = platform_get_irq(pdev, 0); 580 592 581 593 free_irq(irq, dmadev); 594 + 595 + jz4740_cleanup_vchan(&dmadev->ddev); 582 596 dma_async_device_unregister(&dmadev->ddev); 583 597 clk_disable_unprepare(dmadev->clk); 584 598