On Thu, 2017-05-11 at 13:28 +0200, Wolfram Sang wrote: > On Tue, May 09, 2017 at 02:03:51PM +0200, Joakim Tjernlund wrote: > > Current I2C reset procedure is broken in two ways: > > 1) It only generate 1 START instead of 9 STARTs and STOP. > > 2) It leaves the bus Busy so every I2C xfer after the first > > fixup calls the reset routine again, for every xfer there after. > > > > This fixes both errors. Add an iobarrier_rw() when writing the > > I2C control register as well to make sure the register reaches the > > controller in time. > > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@xxxxxxxxxxxx> > > BTW can this driver be converted to make use of the bus_recovery > infrastructure? > Maybe, I not familiar with this infrastructure. I did take a look at i2c_generic_recovery() though and I do not agree with that impl. The 9 clk's fixup does not cover the the case when an I2C device is stuck write. To fix stuck in both cases(read or write) you need to generate 9 clk's with a START in each clk, then a STOP to release the bus. Jocke -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html