spi: cadence-qspi: add no-IRQ mode to indirect reads
authorThéo Lebrun <theo.lebrun@bootlin.com>
Tue, 23 Apr 2024 10:01:41 +0000 (12:01 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 26 Apr 2024 02:09:23 +0000 (11:09 +0900)
commit1f257b92e6330d576cc826fb8f0b74fe0e8209de
tree5285bf6ec2549d61ccefdca5f8ce491d45ce2ce9
parent3bf64a2b66edffd28614b004648ccd60e3139c9e
spi: cadence-qspi: add no-IRQ mode to indirect reads

Support reads through polling, without any IRQ. The main reason is
performance; profiling shows that the first IRQ comes quickly on our
specific hardware. Once this IRQ arrives, we poll until all data is
retrieved. Avoid initial sleep to reduce IRQ count.

Hide this behavior behind a quirk flag.

This is confirmed through micro-benchmarks, but also end-to-end
performance tests. Mobileye EyeQ5, octal flash, reading 235M on a UBIFS
filesystem:
 - No optimizations, ~10.34s, ~22.7 MB/s, 199230 IRQs
 - CQSPI_SLOW_SRAM,  ~10.34s, ~22.7 MB/s,  70284 IRQs
 - CQSPI_RD_NO_IRQ,   ~9.37s, ~25.1 MB/s,    521 IRQs

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240423-cdns-qspi-mbly-v4-2-3d2a7b535ad0@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c