Skip to content

Commit 05897c7

Browse files
l1kbroonie
authored andcommitted
spi: bcm2835: Tear down DMA before turning off SPI controller
On unbind of the BCM2835 SPI driver, the SPI controller is disabled first and the DMA channels are terminated and torn down afterwards. This seems backwards: In the theoretical case that DMA is active, it might try to fill the SPI FIFOs even after the controller has been disabled. Reverse the order, thereby mirroring what's done on ->probe(). Signed-off-by: Lukas Wunner <[email protected]> Link: https://lore.kernel.org/r/ac79f1e3d6fd9a1f5e0cb4008c43b98ea70be3c2.1589557526.git.lukas@wunner.de Signed-off-by: Mark Brown <[email protected]>
1 parent c38a490 commit 05897c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-bcm2835.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,14 +1380,14 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
13801380

13811381
spi_unregister_controller(ctlr);
13821382

1383+
bcm2835_dma_release(ctlr, bs);
1384+
13831385
/* Clear FIFOs, and disable the HW block */
13841386
bcm2835_wr(bs, BCM2835_SPI_CS,
13851387
BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
13861388

13871389
clk_disable_unprepare(bs->clk);
13881390

1389-
bcm2835_dma_release(ctlr, bs);
1390-
13911391
return 0;
13921392
}
13931393

0 commit comments

Comments
 (0)