Hi Mark, broonie@xxxxxxxxxx wrote on Fri, 16 Jun 2023 15:20:27 +0100: > On Fri, Jun 16, 2023 at 04:12:25PM +0200, Miquel Raynal wrote: > > > -#define SPI_DMA_TIMEOUT (msecs_to_jiffies(1000)) > > +#define SPI_DMA_MIN_TIMEOUT (msecs_to_jiffies(1000)) > > +#define SPI_DMA_TIMEOUT_PER_10K (msecs_to_jiffies(4)) > > Given that we know the bus speed can't we just calculate this like other > drivers do (we should probably add a helper TBH)? I agree we should probably have some kind of easy-to-use helper to derive a decent timeout value. How do sound the heuristics proposed here to you ? That would be: timeout = 1s + 4ms/10k Thanks, Miquèl