lkml.org 
[lkml]   [2020]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v1 RFC 1/2] spi: introduce fallback to pio
Date
On 2020/06/15 22:36 Mark Brown <broonie@kernel.org> wrote: 
> On Mon, Jun 15, 2020 at 02:18:54PM +0000, Robin Gong wrote:
> > Seems not easy to find a suitable error value, how about EBADR which
> > sounds like no any available dma_async_tx_descriptor got by calling
> dmaengine_prep_slave_sg?
>
> > #define EBADR 53 /* Invalid request descriptor */
>
> We could also pass in a flag that could be set separately to the error code to
> indicate that nothing had happened to the hardware yet.
Do you mean spi-imx.c checking 'ctlr->flags' before return such error code?
Or just like below done in spi.c.
+fallback_pio:
ret = ctlr->transfer_one(ctlr, msg->spi, xfer);
if (ret < 0) {
+ if (ret == - EBADR && ctlr->cur_msg_mapped &&
+ (ctlr->flags & SPI_CONTROLLER_FALLBACK)) {
+ __spi_unmap_msg(ctlr, msg);
+ ctlr->fallback = true;
+ goto fallback_pio;
+ }
+

\
 
 \ /
  Last update: 2020-06-15 16:54    [W:0.073 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site