Skip to content

Commit

Permalink
i2c: omap: fix draining irq handling
Browse files Browse the repository at this point in the history
Commit 0bdfe0c (i2c: omap: sanitize
exit path) changed the interrupt handler to exit early and complete
the transfer after the draining IRQ is handled. As a result, the ARDY
may not be cleared properly, and it may cause all future I2C transfers
to timeout with "timeout waiting for bus ready". This is reproducible
at least with N900 when twl4030_gpio makes a long write (> FIFO size)
during the probe (http://marc.info/?l=linux-omap&m=135818882610432&w=2).

The fix is to continue until we get ARDY interrupt that completes the
transfer. Tested with 3.8-rc4 + N900: 20 boots in a row without errors;
without the patch the problem triggers after few reboots.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
  • Loading branch information
Aaro Koskinen authored and Wolfram Sang committed Jan 22, 2013
1 parent 2c5de55 commit 9eb13cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
i2c_omap_errata_i207(dev, stat);

omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RDR);
break;
continue;
}

if (stat & OMAP_I2C_STAT_RRDY) {
Expand All @@ -989,7 +989,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
break;

omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XDR);
break;
continue;
}

if (stat & OMAP_I2C_STAT_XRDY) {
Expand Down

0 comments on commit 9eb13cf

Please sign in to comment.