From: "Jett.Zhou" <jtzhou@xxxxxxxxxxx> According to some test in emei_dkb, we found some i2c slave device (eg. camera sensor ov2659 power up) introduce noise on sda, so detect i2c controller busy, and assert reset to i2c controller to recover as early as possible to avoid more latency on the entire i2c transaction. Signed-off-by: Jett.Zhou <jtzhou@xxxxxxxxxxx> [vaibhav.hiremath@xxxxxxxxxx: Removed reduction in timeout value, as I do not have goot explanation for it. Logically it is not required. And also Updated changelog] Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@xxxxxxxxxx> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@xxxxxxxxxx> --- drivers/i2c/busses/i2c-pxa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index d4c798a..a76c901 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -314,6 +314,10 @@ static int i2c_pxa_wait_bus_not_busy(struct pxa_i2c *i2c) { int timeout = DEF_TIMEOUT; + if (readl(_ISR(i2c)) & (ISR_IBB | ISR_UB)) + i2c_pxa_reset(i2c); + + while (timeout-- && readl(_ISR(i2c)) & (ISR_IBB | ISR_UB)) { if ((readl(_ISR(i2c)) & ISR_SAD) != 0) timeout += 4; -- 1.9.1 -- 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