]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4bc0e74c0c8226ff061d6a4e7f95bb203d11373d
tree64458c4970bab1cdccef890aa54f6267fa28c346
parentdb8a9e972d6d46bfe2df14bc90a6cf731bb379e2
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