]> git.karo-electronics.de Git - linux-beck.git/commitdiff
dmaengine: sun6i: Free the interrupt before killing the tasklet
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 30 Jul 2014 08:30:22 +0000 (10:30 +0200)
committerVinod Koul <vinod.koul@intel.com>
Wed, 30 Jul 2014 13:44:17 +0000 (19:14 +0530)
There's still a small window between the call to sun6i_kill_tasklet and the end
of the driver remove function where a spurious interrupt might trigger, and
start using deallocated resources.

Replace the call to synchronize_irq by a free_irq, so that we're sure that we
won't get any further interrupts when we're deallocating resources.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sun6i-dma.c

index 609c5d8cb94763c3d0e2cd367ab70f2b4f4c94cc..63a1db38894e3febe1888376d1e6786664c0561f 100644 (file)
@@ -836,8 +836,8 @@ static inline void sun6i_kill_tasklet(struct sun6i_dma_dev *sdev)
        /* Prevent spurious interrupts from scheduling the tasklet */
        atomic_inc(&sdev->tasklet_shutdown);
 
-       /* Make sure all interrupts are handled */
-       synchronize_irq(sdev->irq);
+       /* Make sure we won't have any further interrupts */
+       devm_free_irq(sdev->slave.dev, sdev->irq, sdev);
 
        /* Actually prevent the tasklet from being scheduled */
        tasklet_kill(&sdev->task);