Skip to content

Commit 5ecd833

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 <phil@raspberrypi.com>
1 parent 604cca8 commit 5ecd833

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/spi/spi-dw-dma.c

+6
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ static int dw_spi_dma_wait_tx_done(struct dw_spi *dws,
304304
return -EIO;
305305
}
306306

307+
if (!xfer->rx_buf) {
308+
delay.value = dws->n_bytes * BITS_PER_BYTE;
309+
while (dw_readl(dws, DW_SPI_SR) & DW_SPI_SR_BUSY)
310+
spi_delay_exec(&delay, xfer);
311+
}
312+
307313
return 0;
308314
}
309315

0 commit comments

Comments
 (0)