i2c: pasemi: Improve timeout handling
authorSven Peter <sven@svenpeter.dev>
Sun, 27 Apr 2025 11:30:44 +0000 (11:30 +0000)
committerAndi Shyti <andi@smida.it>
Mon, 19 May 2025 20:23:57 +0000 (22:23 +0200)
commit390b8f5834cf9af98cc2e783f7d10d63ead7f56a
treec7fc6c300cf8120cbdabea92bc4a016bd7587d42
parent88fe3078b54c9efaea7d1adfcf295e37dfb0274f
i2c: pasemi: Improve timeout handling

The hardware (supposedly) has a 25ms timeout for clock stretching
and the driver uses 100ms which should be plenty.
The interrupt path however misses handling for errors while waiting for
the completion and the polling path uses an open-coded readx_poll_timeout.
Note that we drop reg_write(smbus, REG_SMSTA, status) while fixing those
issues here which will be done anyway whenever the next transaction starts
via pasemi_smb_clear.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
Link: https://lore.kernel.org/r/20250427-pasemi-fixes-v3-2-af28568296c0@svenpeter.dev
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-pasemi-core.c