mpfs/CoreSPI: Fix bug when waiting for last character to arrive

The logic for rx_fifo_empty is wrong, needs a loop for the retry to work
This commit is contained in:
Ville Juven 2023-05-22 17:30:10 +03:00 committed by Alan Carvalho de Assis
parent 8d646fc49c
commit fc5e8ff8f8

View File

@ -781,8 +781,7 @@ static void mpfs_spi_unload_rx_fifo(struct mpfs_spi_priv_s *priv,
for (i = 0; i < nwords; i++)
{
rx_fifo_empty = getreg32(MPFS_SPI_STATUS) & MPFS_SPI_RXEMPTY;
if (rx_fifo_empty)
while ((rx_fifo_empty = getreg32(MPFS_SPI_STATUS) & MPFS_SPI_RXEMPTY))
{
/* Last RX character not ready yet, try again (once) */