mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
spi: rockchip: terminate dma transmission when slave abort
[ Upstream commit 80808768e4 ]
After slave abort, all DMA should be stopped, or it will affect the
next transmission and maybe abort again.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-3-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
889254f98e
commit
8c023c3039
@@ -567,6 +567,12 @@ static int rockchip_spi_slave_abort(struct spi_controller *ctlr)
|
||||
{
|
||||
struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
|
||||
|
||||
if (atomic_read(&rs->state) & RXDMA)
|
||||
dmaengine_terminate_sync(ctlr->dma_rx);
|
||||
if (atomic_read(&rs->state) & TXDMA)
|
||||
dmaengine_terminate_sync(ctlr->dma_tx);
|
||||
atomic_set(&rs->state, 0);
|
||||
spi_enable_chip(rs, false);
|
||||
rs->slave_abort = true;
|
||||
complete(&ctlr->xfer_completion);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user