lkml.org 
[lkml]   [2020]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 RFC 1/2] spi: introduce fallback to pio
On Thu, Jun 11, 2020 at 08:58:29PM +0800, Robin Gong wrote:
> Add SPI_CONTROLLER_FALLBACK to fallback to pio mode in case dma transfer
> failed.
> If spi client driver want to enable this feature please set master->flags
> with SPI_MASTER_FALLBACK and add master->fallback checking in its can_dma()
> as spi-imx.c

If we were going to do this I don't see why we'd have a flag for this
rather than just doing it unconditionally but...

> ret = ctlr->transfer_one(ctlr, msg->spi, xfer);
> if (ret < 0) {
> + if (ctlr->cur_msg_mapped &&
> + (ctlr->flags & SPI_CONTROLLER_FALLBACK)) {
> + __spi_unmap_msg(ctlr, msg);
> + ctlr->fallback = true;
> + goto fallback_pio;
> + }

...I don't think this can work sensibly - this is going to try PIO if
there's *any* error. We might have had some sort of issue during the
transfer for example so have some noise on the bus. Like I said on a
prior version of this I really think that we need to be figuring out if
the DMA controller can support the transaction before we even map the
buffer for it, having the controller just randomly fail underneath the
consumer just does not sound robust.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-06-11 15:41    [W:0.087 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site