Skip to content

Commit 805e71d

Browse files
author
Patrice Chotard
committed
spi: stm32-qspi: Increase read throughput in indirect mode
When WATCHDOG_RESET() was replaced by schedule() in commit 29caf93 ("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. Schedule() is called every u8/u16 or u32 read accesses which is overkill. 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% Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Change-Id: I24d8196604e6c8f690a0b2024ee562d344d78f33 Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/518997 ACI: CIBUILD <MDG-smet-aci-builds@list.st.com> Domain-Review: Christophe KERELLO <christophe.kerello@st.com>
1 parent 026345d commit 805e71d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/spi/stm32_qspi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ static void _stm32_qspi_read_fifo(void *val, void __iomem *addr, u8 len)
175175
case sizeof(u8):
176176
*((u8 *)val) = readb_relaxed(addr);
177177
};
178-
schedule();
179178
}
180179

181180
static void _stm32_qspi_write_fifo(void *val, void __iomem *addr, u8 len)
@@ -236,6 +235,9 @@ static int _stm32_qspi_poll(struct stm32_qspi_priv *priv,
236235
fifo(buf, &priv->regs->dr, step);
237236
len -= step;
238237
buf += step;
238+
239+
if (!(len % SZ_1M))
240+
schedule();
239241
}
240242

241243
return 0;

0 commit comments

Comments
 (0)