[PATCH 4/5] spi: cadence-xspi: Don't use infinite timeout in register poll
From: Paul Cercueil
Date: Mon Oct 05 2026 - 04:13:13 EST
From: Tanmay Jagdale <tanmay@xxxxxxxxxxx>
The functions cdns_xspi_is_{sdma,stig}_ready() take a 'sleep' argument
which, if false, would result in the polling being a busy-wait.
But it would also switch to infinite timeouts, which we don't want.
Note that this code is dead right now ('sleep' is always true) but this
will change when panic write handling is implemented.
Signed-off-by: Tanmay Jagdale <tanmay@xxxxxxxxxxx>
Co-developed-by: Paul Cercueil <paul.cercueil@xxxxxxxxxxx>
Signed-off-by: Paul Cercueil <paul.cercueil@xxxxxxxxxxx>
---
drivers/spi/spi-cadence-xspi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
index 7cf52bcb05df..09ed2afbd4af 100644
--- a/drivers/spi/spi-cadence-xspi.c
+++ b/drivers/spi/spi-cadence-xspi.c
@@ -374,7 +374,7 @@ static bool cdns_xspi_is_stig_ready(struct cdns_xspi_dev *cdns_xspi, bool sleep)
ctrl_stat,
((ctrl_stat & BIT(3)) == 0),
sleep ? MRVL_XSPI_POLL_DELAY_US : 0,
- sleep ? MRVL_XSPI_POLL_TIMEOUT_US : 0);
+ MRVL_XSPI_POLL_TIMEOUT_US);
}
static bool cdns_xspi_is_sdma_ready(struct cdns_xspi_dev *cdns_xspi, bool sleep)
@@ -386,7 +386,7 @@ static bool cdns_xspi_is_sdma_ready(struct cdns_xspi_dev *cdns_xspi, bool sleep)
ctrl_stat,
(ctrl_stat & CDNS_XSPI_SDMA_TRIGGER),
sleep ? MRVL_XSPI_POLL_DELAY_US : 0,
- sleep ? MRVL_XSPI_POLL_TIMEOUT_US : 0);
+ MRVL_XSPI_POLL_TIMEOUT_US);
}
static void cdns_xspi_trigger_command(struct cdns_xspi_dev *cdns_xspi,
--
2.47.3