]> www.infradead.org Git - users/willy/xarray.git/commit
i2c: xiic: Try re-initialization on bus busy timeout
authorRobert Hancock <robert.hancock@calian.com>
Wed, 11 Sep 2024 20:16:53 +0000 (22:16 +0200)
committerAndi Shyti <andi.shyti@kernel.org>
Wed, 11 Sep 2024 20:21:21 +0000 (22:21 +0200)
commit1d4a1adbed2582444aaf97671858b7d12915bd05
tree9c2b8ac561217813e86b4f0baf9bfdcd57c51492
parent521da1e9225450bd323db5fa5bca942b1dc485b7
i2c: xiic: Try re-initialization on bus busy timeout

In the event that the I2C bus was powered down when the I2C controller
driver loads, or some spurious pulses occur on the I2C bus, it's
possible that the controller detects a spurious I2C "start" condition.
In this situation it may continue to report the bus is busy indefinitely
and block the controller from working.

The "single-master" DT flag can be specified to disable bus busy checks
entirely, but this may not be safe to use in situations where other I2C
masters may potentially exist.

In the event that the controller reports "bus busy" for too long when
starting a transaction, we can try reinitializing the controller to see
if the busy condition clears. This allows recovering from this scenario.

Fixes: e1d5b6598cdc ("i2c: Add support for Xilinx XPS IIC Bus Interface")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Cc: <stable@vger.kernel.org> # v2.6.34+
Reviewed-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-xiic.c