Skip to content

Commit

Permalink
spi: dw: Wait for idle after TX
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pelwell committed Feb 4, 2025
1 parent 8a08b4a commit 54a442d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/spi/spi-dw-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ static int dw_spi_dma_wait_tx_done(struct dw_spi *dws,
return -EIO;
}

if (!xfer->rx_buf) {
while (dw_readl(dws, DW_SPI_SR) & DW_SPI_SR_BUSY)
cpu_relax();
}

return 0;
}

Expand Down

0 comments on commit 54a442d

Please sign in to comment.