Re: [PATCH] spi: use udelay() for short polling delays

From: Peter Collingbourne

Date: Tue May 19 2026 - 06:38:31 EST


On Mon, May 18, 2026 at 3:46 AM Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> On Sat, May 16, 2026 at 11:25:54PM -0700, Peter Collingbourne wrote:
>
> > + if (polling_delay_us < 10)
> > + ret = read_poll_timeout_atomic(
> > + spi_mem_read_status, read_status_ret,
> > + (read_status_ret || ((status)&mask) == match),
> > + polling_delay_us, timeout_ms * 1000, false, mem,
> > + op, &status);
> > + else
> > + ret = read_poll_timeout(
> > + spi_mem_read_status, read_status_ret,
> > + (read_status_ret || ((status)&mask) == match),
> > + polling_delay_us, timeout_ms * 1000, false, mem,
> > + op, &status);
>
> This seems like something that should be fixed in read_poll_timeout()
> rather than open coded in a user, similarly to how fsleep() is there for
> sleep functions.

Sounds reasonable, sent v2 with the fix moved to read_poll_timeout().

Peter