RE: [PATCH v1 RFC 1/2] spi: introduce fallback to pio

From: Robin Gong
Date: Mon Jun 15 2020 - 09:35:10 EST


On 2020/06/15 20:36 Mark Brown <broonie@xxxxxxxxxx> wrote:
> On Sun, Jun 14, 2020 at 01:04:57PM +0000, Robin Gong wrote:
>
> Please delete unneeded context from mails when replying. Doing this makes
> it much easier to find your reply in the message, helping ensure it won't be
> missed by people scrolling through the irrelevant quoted material.
Okay, thanks Mark.
>
> > > No, I mean that the reason the DMA transfer fails may be something
> > > that happens after we've started putting things on the bus - the bit
> > > about FIFOs is just a random example of an error that could happen.
>
> > Sorry Mark for that I can't get your point... The bus error such as
> > data corrupt seems not the spi core's business since it can only be
> > caught in spi controller driver or upper level such as mtd driver
> > (spi-nor) which know what's the failure happen at spi bus HW level or
> > what's the correct data/message. In other words, spi core can't detect such
> error by transfer_one().
>
> If we see an error in transfer_one() it could be from anything, we've no idea
> what happened on the bus - the controller may have got part way through the
> transfer before failing.
Then how about choosing specific error code for such dma not ready case where
nothing went out on the bus neither?

>
> > But despite of that case, do you think this patch is valid for
> > transfer_one() failue in dma and fallback to pio?
>
> No, not unless we know that nothing went out on the bus.