mbox series

[v2,0/2] introduce fallback to pio in spi core

Message ID 1592347329-28363-1-git-send-email-yibin.gong@nxp.com (mailing list archive)
Headers show
Series introduce fallback to pio in spi core | expand

Message

Robin Gong June 16, 2020, 10:42 p.m. UTC
Introudce fallback pio way at spi core level so that the tx/rx buffer
mapped by spi core for dma could be unmap and fallback pio again. Hence no
need the below patch where 'dma_sync_sg_for_devic' to sync fresh data back
into 'device' memory and sync to 'cpu' again in spi core.
https://www.spinics.net/lists/arm-kernel/msg812236.html

If you want to use this fallback feature, please set xfer->error with
SPI_TRANS_FAIL_NO_START in case dma transfer failed(but no any data push
into spi bus yet) in spi client driver and add 'master->fallback' checking
in your can_dma() to ensure spi core can fallback to pio next time.

change from:
v2: 
  1. Add error flag in stuct spi_transfer and fallback to pio if spi client
     return SPI_TRANS_FAIL_NO_START failure before dma transfer start.
  2. Remove SPI_MASTER_FALLBACK set on master->flags since the above error
     flag could ensure no any impact for other spi client drivers which don't
     need this feature.

Robin Gong (2):
  spi: introduce fallback to pio
  spi: imx: add fallback feature

 drivers/spi/spi-imx.c   | 23 +++++------------------
 drivers/spi/spi.c       | 11 +++++++++++
 include/linux/spi/spi.h |  4 ++++
 3 files changed, 20 insertions(+), 18 deletions(-)

Comments

Mark Brown June 24, 2020, 3:38 p.m. UTC | #1
On Wed, 17 Jun 2020 06:42:07 +0800, Robin Gong wrote:
> Introudce fallback pio way at spi core level so that the tx/rx buffer
> mapped by spi core for dma could be unmap and fallback pio again. Hence no
> need the below patch where 'dma_sync_sg_for_devic' to sync fresh data back
> into 'device' memory and sync to 'cpu' again in spi core.
> https://www.spinics.net/lists/arm-kernel/msg812236.html
> 
> If you want to use this fallback feature, please set xfer->error with
> SPI_TRANS_FAIL_NO_START in case dma transfer failed(but no any data push
> into spi bus yet) in spi client driver and add 'master->fallback' checking
> in your can_dma() to ensure spi core can fallback to pio next time.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: introduce fallback to pio
      commit: 809b1b04df898b6d182069146231a3cbf5f2d9cc
[2/2] spi: imx: add fallback feature
      commit: 7a908832ace7543ca996303928bfed7190dd2cdd

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark