Skip to contentSkip to conversation

spi: xilinx: increase number of retries before declaring stall

PATCH Superseded ÁlvaroG. M. 3 participants 5 messages Nov 6, 2025 – Nov 7, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: xilinx: increase number of retries before declaring stall

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.

---
 drivers/spi/spi-xilinx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-xilinx.c +0 -0
index d59cc8a18484..c86dc56f38b4 100644
@@ -300,7 +300,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) &&

Signature · 1 line
2.49.0
Reviewed-by Ricardo Ribalda on v1 1/1
#1 lore raw
Quoted 10 lines · Álvaro G. M.

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.

Quoted 21 lines
---
 drivers/spi/spi-xilinx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-xilinx.c +1 -1
index d59cc8a18484..c86dc56f38b4 100644
@@ -300,7 +300,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) &&

--
2.49.0

maintainer
#2 lore raw
In reply to ÁlvaroG. M.
Quoted 7 lines · Álvaro G. M.

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.

This doesn't apply against current code, please check and resend.

#3 lore raw
Quoted 10 lines · Mark Brown
Quoted 7 lines · Álvaro G. M.

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.

This doesn't apply against current code, please check and resend.

Sorry, I think my email client mangled that. I've tried again with git send- email

Thanks,

maintainer
#4 lore raw
In reply to ÁlvaroG. M.
Quoted 9 lines · Álvaro G. M.

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.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: xilinx: increase number of retries before declaring stall

      commit: 939edfaa10f1d22e6af6a84bf4bd96dc49c67302

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark