spi: Add DMA mode support to spi-qcom-qspi
authorMark Brown <broonie@kernel.org>
Mon, 8 May 2023 13:25:26 +0000 (22:25 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 8 May 2023 13:25:26 +0000 (22:25 +0900)
commitdd69654cd32acad1a32d8e1c7b085a34db9d47e5
tree9b9f884b5a19db2649204ac94ff085fae933a9ae
parent97a03a9b9361108bbd82446661367e0082a68518
parentb5762d95607e74eec91ef39c7902f127c80d43aa
spi: Add DMA mode support to spi-qcom-qspi

Merge series from Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>:

There are large number of QSPI irqs that fire during boot/init and later
on every suspend/resume.
This could be made faster by doing DMA instead of PIO.
Below is comparison for number of interrupts raised in 2 scenarios...
Boot up and stabilise
Suspend/Resume

Sequence   PIO    DMA
=======================
Boot-up    69088  19284
S/R        5066   3430

Speed test results...
spi-nor read times in sec after 2 min uptime
============================================
PIO - Iterations-1000, min=3.18, max=3.74, avg=3.53
DMA - Iterations-1000, min=1.21, max=2.28, avg=1.79

spi-nor write times in sec after 2 min uptime
=============================================
PIO - Iterations-1000, min=3.20, max=8.24, avg=3.58
DMA - Iterations-1000, min=1.25, max=5.13, avg=1.82

Further testing performed...
a) multiple entries in sgt (simulated by max_dma_len = 1024)
b) fallback to pio (simulated by dma setup failure)