Re: spi-imx: wait_for_completion should timeout even in non-DMA transfer cases

From: Mark Brown
Date: Tue Sep 22 2015 - 13:29:54 EST


On Mon, Sep 21, 2015 at 11:08:55AM +0200, Jean-Michel Hautbois wrote:
> 2015-09-19 19:56 GMT+02:00 Mark Brown <broonie@xxxxxxxxxx>:

> > A calculated timeout is probably best.

> Well, it depends...
> If you have a 20MHz clock, then you can transfer a byte in 4µs.
> As most of the time pio_transfer is used for 8 to 32 bytes max, it
> would be irrelevant to use such a small timeout.
> I can obviously do it, but not sure if using a small (say, 100ms)
> timeout would not be better.

You want a minimum threashold, yes, but you also need to be able toc ope
with larger transfers too so need to be able to raise that where
appropriate.

Attachment: signature.asc
Description: Digital signature