]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
i2c: ocores: Use read_poll_timeout_atomic to avoid false poll timeouts
authorMartin Aberer <martin.aberer@bachmann.info>
Tue, 24 Mar 2026 14:05:56 +0000 (15:05 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Fri, 27 Mar 2026 13:53:25 +0000 (14:53 +0100)
commit8461f5e3887404b19ba073fd1cc92e2f8f73185b
tree826f66457e5c4f2d4beb0a913d89bb97b832e16a
parent3762e535f2c9b31716a982d9fdd5c51d5ec7aa42
i2c: ocores: Use read_poll_timeout_atomic to avoid false poll timeouts

Replace the manual polling loop in ocores_wait() with the kernel helper
read_poll_timeout_atomic(). This simplifies the code and ensures robust
timeout handling.

In particular, the helper guarantees a condition check after the
delay, even if the delay exceeds the timeout, avoiding spurious
timeout errors under load or preemption.

Signed-off-by: Martin Aberer <martin.aberer@bachmann.info>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260324140556.2249039-1-martin.aberer@bachmann.info
drivers/i2c/busses/i2c-ocores.c