Skip to content

Commit aa131af

Browse files
committed
spi: dw: Wait for idle after TX
If this is a DMA transfer, and if there is no simultaneous RX transfer, wait for the interface to go idle before reporting that TX is done. Link: https://forums.raspberrypi.com/viewtopic.php?t=383027 Signed-off-by: Phil Elwell <[email protected]>
1 parent 8a08b4a commit aa131af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/spi/spi-dw-dma.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ static int dw_spi_dma_wait_tx_done(struct dw_spi *dws,
303303
dev_err(&dws->host->dev, "Tx hanged up\n");
304304
return -EIO;
305305
}
306+
307+
if (!xfer->rx_buf) {
308+
while (dw_readl(dws, DW_SPI_SR) & DW_SPI_SR_BUSY)
309+
cpu_relax();
310+
}
306311

307312
return 0;
308313
}

0 commit comments

Comments
 (0)