From: "Álvaro G. M." <alvaro.gamez@hazent.com>
To: linux-spi@vger.kernel.org
Cc: Ricardo Ribalda Delgado <ribalda@kernel.org>,
Michal Simek <michal.simek@amd.com>,
Mark Brown <broonie@kernel.org>
Subject: [PATCH] spi: xilinx: increase number of retries before declaring stall
Date: Thu, 06 Nov 2025 13:14:04 +0100 [thread overview]
Message-ID: <40ca72b63d52d2db4d03ed45d17edd1000290c3a.camel@hazent.com> (raw)
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>
---
drivers/spi/spi-xilinx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index d59cc8a18484..c86dc56f38b4 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -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
next reply other threads:[~2025-11-06 12:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 12:14 Álvaro G. M. [this message]
2025-11-06 12:24 ` [PATCH] spi: xilinx: increase number of retries before declaring stall Ricardo Ribalda Delgado
2025-11-06 13:15 ` Mark Brown
2025-11-06 13:46 ` Álvaro G. M.
2025-11-07 15:59 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40ca72b63d52d2db4d03ed45d17edd1000290c3a.camel@hazent.com \
--to=alvaro.gamez@hazent.com \
--cc=broonie@kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=ribalda@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).