Re: [PATCH v2 1/2] i2c: ocores: increase poll timeout to total transfer timeout
From: Wolfram Sang
Date: Wed Jan 14 2026 - 04:35:07 EST
Hi Matthias,
> This code does not have interrupts disabled, we could not fall back from
> read_poll_timeout_atomic() to read_poll_timeout() otherwise.
Yes, that's what I thought as well.
> that a sleeping wait would make it more likely for a switch to a different task
> to happen after every byte, negatively impacting I2C performance; this is not
> something I have verified however.
Quite some prominent controller drivers use readX_poll_timeout(), so it
really seems there is no huge penalty in practice. Especially not with
cores so fast these days that tasks can be served even in 100us.
> It is spinning for 1ms because that's what the old code did (which only spun
> without fallback to sleeping).
I understand. Yet, I think the spinning is legacy behaviour and I would
prefer plain readX_poll_timeout(). Unless there is something I
overlooked. Makes the code simpler and easier to maintain.
Thanks and happy hacking,
Wolfram
Attachment:
signature.asc
Description: PGP signature