Re: [PATCH v4 2/3] i2c: qcom-geni: Add bus recovery support for FIFO mode
From: Mukesh Savaliya
Date: Tue Nov 03 2026 - 07:51:54 EST
On 11/3/2026 2:26 PM, Aniket Randive wrote:
I2C transfers in FIFO mode can fail with -EPROTO, -ETIMEDOUT orReviewed-by: Mukesh Kumar Savaliya <mukesh.savaliya@xxxxxxxxxxxxxxxx>
-EAGAIN when a target holds SDA low, leaving the bus stuck and
preventing subsequent transactions.
Add bus recovery support using the I2C_BUS_CLEAR and I2C_STOP_ON_BUS
hardware opcodes to restore the bus to an idle state. Check the SDA
line state through SE_GENI_IOS.RX_DATA_IN and skip recovery when the
bus is already free. Trigger recovery automatically from
geni_i2c_xfer() on -EPROTO, -ETIMEDOUT and -EAGAIN (arbitration-lost)
errors, and register the recovery callback through i2c_bus_recovery_info
to allow recovery via i2c_recover_bus().
Use the adapter timeout for recovery commands. Configure the serial clock
and bus timing after runtime resume so direct calls to i2c_recover_bus()
do not depend on an earlier transfer having configured them.
This adds bus recovery support for FIFO mode only.
Signed-off-by: Aniket Randive <aniket.randive@xxxxxxxxxxxxxxxx>
---