]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:10 +0000 (12:00 +0200)
commit8812b6f98fbe52b1ca59c39addf8c9b5d68b47b0
tree72237e917b655742667ace4ed7cf4729d58b2ab6
parent5dfeb9d2f58dae779453e87f4b73cc75bb67df4d
i2c: xiic: Try re-initialization on bus busy timeout

[ Upstream commit 1d4a1adbed2582444aaf97671858b7d12915bd05 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-xiic.c