Skip to content

Commit 8c023c3

Browse files
Jon Lingregkh
Jon Lin
authored andcommitted
spi: rockchip: terminate dma transmission when slave abort
[ Upstream commit 8080876 ] After slave abort, all DMA should be stopped, or it will affect the next transmission and maybe abort again. Signed-off-by: Jon Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 889254f commit 8c023c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: drivers/spi/spi-rockchip.c

+6
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ static int rockchip_spi_slave_abort(struct spi_controller *ctlr)
567567
{
568568
struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
569569

570+
if (atomic_read(&rs->state) & RXDMA)
571+
dmaengine_terminate_sync(ctlr->dma_rx);
572+
if (atomic_read(&rs->state) & TXDMA)
573+
dmaengine_terminate_sync(ctlr->dma_tx);
574+
atomic_set(&rs->state, 0);
575+
spi_enable_chip(rs, false);
570576
rs->slave_abort = true;
571577
complete(&ctlr->xfer_completion);
572578

0 commit comments

Comments
 (0)