Re: [PATCH v2 1/2] i2c: ocores: increase poll timeout to total transfer timeout

From: Andrew Lunn

Date: Tue Jan 13 2026 - 09:21:09 EST


On Tue, Jan 13, 2026 at 02:02:07PM +0100, Wolfram Sang wrote:
>
> > The behavior in the regular case is unchanged, spinning for up to 1ms,
> > but the open-coded poll loop is replaced with read_poll_timeout_atomic()
> > as suggested by Andrew Lunn.
>
> Hmm, spinning 1ms is still a lot. Can't we just use read_poll_timeout()
> for the whole timeout? I can't see that it will cause a regression. But
> please correct me if I am wrong.

I've forgotten the context, but

/**
* ocores_poll_wait() - Wait until is possible to process some data
* @i2c: ocores I2C device instance
*
* Used when the device is in polling mode (interrupts disabled).

If interrupts are disabled, you cannot use read_poll_timeout(). You
have to use read_poll_timeout_atomic(). And that spins anyway.

Andrew