Re: [PATCH v2] iopoll: use udelay() for initial polling

From: Mark Brown

Date: Fri May 29 2026 - 17:59:14 EST


On Fri, May 29, 2026 at 12:20:16PM +0100, David Laight wrote:

> I think I remember someone saying that the spi hardware interface normally
> generates an interrupt when the request completes?
> So for spi this is only fall-back code for a few systems.

For something like spi-mem I'd expect to have interrupt support, we go
all the way down to fully bitbanged though. You also often have
copybreak cutoffs for smaller transfers (and quicker operations) where
it's more efficient to poll for completion than use an interrupt, or
PIO rather than DMA.

> The code has this comment:
> /* Wait for the write - typically 0.6ms (max 5ms).
> * In spite of the datasheet values, I'm seeing 200us writes. */
> It waits 200us and then polls every 50us for 2 seconds.

You can also get fun with things like contention on shared buses.

Attachment: signature.asc
Description: PGP signature