summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratyush Yadav <p.yadav@ti.com>2024-03-09 01:33:53 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2024-03-11 13:51:58 -0500
commit4fcefeccdc1bef5ea0c86f4a1aab7e1d91744b8f (patch)
tree1f7cc0c77db90023ffc72f32055aea77b42ebd40
parente29174df9a8042a26e8898bc46d12961174e9229 (diff)
spi: cadence-quadspi: do not use DMA for reads smaller than 16 bytes
For reads this small it does not make a lot of sense to go through DMA which usually has a significant setup overhead. The benefits of DMA are reaped in larger transfers. This is especially relevant in case a register is being polled. The DMA overhead will make the polling slower than it should be. Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Apurva Nandan <a-nandan@ti.com>
-rw-r--r--drivers/spi/spi-cadence-quadspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 7b89bcf20960..b989e39d0781 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -2062,7 +2062,7 @@ static int cqspi_direct_read_execute(struct cqspi_flash_pdata *f_pdata,
u_char *buf = op->data.buf.in;
int ret;
- if (!cqspi->rx_chan || !virt_addr_valid(buf)) {
+ if (!cqspi->rx_chan || !virt_addr_valid(buf) || len <= 16) {
cqspi_memcpy_fromio(op, buf, cqspi->ahb_base + from, len);
return 0;
}