mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] introduce fallback to pio in spi core
@ 2020-06-16 22:42 Robin Gong
  2020-06-16 22:42 ` [PATCH v2 1/2] spi: introduce fallback to pio Robin Gong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Robin Gong @ 2020-06-16 22:42 UTC (permalink / raw)
  To: broonie, shawnguo, s.hauer, festevam, robin.murphy, matthias.schiffer
  Cc: kernel, linux-imx, linux-spi, linux-arm-kernel, linux-kernel

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(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-24 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 22:42 [PATCH v2 0/2] introduce fallback to pio in spi core Robin Gong
2020-06-16 22:42 ` [PATCH v2 1/2] spi: introduce fallback to pio Robin Gong
2020-06-16 22:42 ` [PATCH v2 2/2] spi: imx: add fallback feature Robin Gong
2020-06-24 15:38 ` [PATCH v2 0/2] introduce fallback to pio in spi core Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®