Linux MIPS Architecture development
 help / color / mirror / Atom feed
* I2C troubles with Au1550
@ 2006-05-18 21:54 Clem Taylor
  2006-05-19 14:32 ` Jordan Crouse
  0 siblings, 1 reply; 7+ messages in thread
From: Clem Taylor @ 2006-05-18 21:54 UTC (permalink / raw)
  To: linux-mips; +Cc: Jordan Crouse

We've been having troubles with the reliability of the I2C interface
on the Au1550.  Basically 1% of the I2C transactions would timeout.
Sometimes the failures would cluster in long runs which was causing
pain.

Last night I got annoyed with the problem enough that I applied a
portion of a Au1200 I2C patch posted by Jordan Crouse on 2005.12.02.
This patch was not applied to the the linux-mips tree (as of
2.6.16.16) but it seems to have fixed our timeout problems. I ran a
I2C test for 14 hours doing constant I2C transactions from user space
and did not see an error.

Maybe Jordan could try again with a fresh patch because it really does
seem to help...

This is the subset of the patch I used:
--- drivers/i2c/busses/i2c-au1550.c	(revision 2271)
+++ drivers/i2c/busses/i2c-au1550.c	(working copy)
@@ -118,13 +118,19 @@

  	/* Reset the FIFOs, clear events.
 	*/
-	sp->psc_smbpcr = PSC_SMBPCR_DC;
+	stat = sp->psc_smbstat;
  	sp->psc_smbevnt = PSC_SMBEVNT_ALLCLR;
 	au_sync();
-	do {
-		stat = sp->psc_smbpcr;
+
+	if (!(stat & PSC_SMBSTAT_TE) || !(stat & PSC_SMBSTAT_RE)) {
+		sp->psc_smbpcr = PSC_SMBPCR_DC;
 		au_sync();
-	} while ((stat & PSC_SMBPCR_DC) != 0);
+		do {
+			stat = sp->psc_smbpcr;
+			au_sync();
+		} while ((stat & PSC_SMBPCR_DC) != 0);
+		udelay(50);
+	}

 	/* Write out the i2c chip address and specify operation
 	*/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-05-19 18:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-18 21:54 I2C troubles with Au1550 Clem Taylor
2006-05-19 14:32 ` Jordan Crouse
2006-05-19 14:48   ` Sergei Shtylyov
2006-05-19 15:08     ` Jordan Crouse
2006-05-19 17:11       ` Sergei Shtylyov
2006-05-19 15:14     ` Ralf Baechle
2006-05-19 15:00   ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox