Skip to contentSkip to conversation

i2c: lpc32xx: fix read timeout

PATCH New slemieux.tyco at gmail.com 2 participants 2 messages Jul 27, 2015 – Aug 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/7 i2c: lpc32xx: fix read timeout

From: Sylvain Lemieux <[email protected]>

Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_read" when parameters alen != 0 and len = 0.

---
 drivers/i2c/lpc32xx_i2c.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/i2c/lpc32xx_i2c.c +5 -5
index 98106fa..4c66769 100644
@@ -172,12 +172,12 @@ static int lpc32xx_i2c_read(struct i2c_adapter *adap, u8 dev, uint addr,
 				*(data++) = readl(&i2c->rx);
 			}
 		}
+		/* wait for end of transation */
+		while (!((stat = readl(&i2c->stat)) & LPC32XX_I2C_STAT_TDI))
+			;
+		/* clear end-of-transaction flag */
+		writel(1, &i2c->stat);
 	}
-	/* wait for end of transation */
-	while (!((stat = readl(&i2c->stat)) & LPC32XX_I2C_STAT_TDI))
-		;
-	/* clear end-of-transaction flag */
-	writel(1, &i2c->stat);
 	/* success */
 	return 0;
 }
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 5/7 i2c: lpc32xx: fix read timeout

Quoted 5 lines · slemieux.tyco at gmail.com

From: Sylvain Lemieux <[email protected]>

Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_read" when parameters alen != 0 and len = 0.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/668a033a/attachment.sig>