]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
spi: xilinx: increase number of retries before declaring stall
authorAlvaro Gamez Machado <alvaro.gamez@hazent.com>
Thu, 6 Nov 2025 13:45:35 +0000 (14:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Dec 2025 17:37:19 +0000 (18:37 +0100)
[ Upstream commit 939edfaa10f1d22e6af6a84bf4bd96dc49c67302 ]

SPI devices using a (relative) slow frequency need a larger time.

For instance, microblaze running at 83.25MHz and performing a
3 bytes transaction using a 10MHz/16 = 625kHz needed this stall
value increased to at least 20. The SPI device is quite slow, but
also is the microblaze, so set this value to 32 to give it even
more margin.

Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20251106134545.31942-1-alvaro.gamez@hazent.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-xilinx.c

index 7795328427a68b9858dc9f97c376ef18a0335c6a..f5e41813b9582aa89f848dda7f6dba6b5341c389 100644 (file)
@@ -299,7 +299,7 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
 
                /* Read out all the data from the Rx FIFO */
                rx_words = n_words;
-               stalled = 10;
+               stalled = 32;
                while (rx_words) {
                        if (rx_words == n_words && !(stalled--) &&
                            !(sr & XSPI_SR_TX_EMPTY_MASK) &&