spi: introduce fallback to pio
authorRobin Gong <yibin.gong@nxp.com>
Tue, 16 Jun 2020 22:42:08 +0000 (06:42 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 23 Jun 2020 12:38:14 +0000 (13:38 +0100)
commit809b1b04df898b6d182069146231a3cbf5f2d9cc
tree64458c4970bab1cdccef890aa54f6267fa28c346
parentc314360cea42e9481d9f68a73a3a776eba31ba4b
spi: introduce fallback to pio

Add fallback to pio mode in case dma transfer failed with error status
SPI_TRANS_FAIL_NO_START.
If spi client driver want to enable this feature please set xfer->error in
the proper place such as dmaengine_prep_slave_sg() failure detect(but no
any data put into spi bus yet). Besides, add master->fallback checking in
its can_dma() so that spi core could switch to pio next time. Please refer
to spi-imx.c.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Link: https://lore.kernel.org/r/1592347329-28363-2-git-send-email-yibin.gong@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
include/linux/spi/spi.h