summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2025-12-16 16:31:53 +0100
committerPatrice Chotard <patrice.chotard@foss.st.com>2026-01-29 10:47:57 +0100
commitaddebf9e818683e176496470b81758529f517825 (patch)
tree2da65e9eefa4a77ff019fa23019e8ab994570cdf
parent9e8bc1c6be751b59e1d782dff3c0cc8703cc18d4 (diff)
spi: stm32-qspi: Increase read throughput in indirect mode
When WATCHDOG_RESET() was replaced by schedule() in commit 29caf9305b6f ("cyclic: Use schedule() instead of WATCHDOG_RESET()") we not only reset the watchdog but also call the cyclic infrastructure which takes time and has impact on read accesses performances. Move schedule() from _stm32_qspi_read_fifo() to _stm32_qspi_poll() and call schedule() only every 1MB chunk of data. Test performed by reading 64MB on sNOR on stm32mp157c-ev1 board: before after ratio Read : 201 KB/s 520KB/s +258% Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
-rw-r--r--drivers/spi/stm32_qspi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/stm32_qspi.c b/drivers/spi/stm32_qspi.c
index 3216ec8010e..1778f8c1458 100644
--- a/drivers/spi/stm32_qspi.c
+++ b/drivers/spi/stm32_qspi.c
@@ -165,7 +165,6 @@ static int _stm32_qspi_wait_cmd(struct stm32_qspi_priv *priv,
static void _stm32_qspi_read_fifo(u8 *val, void __iomem *addr)
{
*val = readb(addr);
- schedule();
}
static void _stm32_qspi_write_fifo(u8 *val, void __iomem *addr)
@@ -200,6 +199,9 @@ static int _stm32_qspi_poll(struct stm32_qspi_priv *priv,
}
fifo(buf++, &priv->regs->dr);
+
+ if (!(len % SZ_1M))
+ schedule();
}
return 0;