Title: [9012] branches/2009R1/drivers/i2c/busses/i2c-bfin-twi.c: [#6136] Illegal i2c bus lock upon certain transfer scenarios
Revision
9012
Author
hennerich
Date
2010-07-23 04:25:03 -0400 (Fri, 23 Jul 2010)

Log Message

[#6136] Illegal i2c bus lock upon certain transfer scenarios

For transfer counts > 255 bytes i2c-bfin-twi sets the data 
transfer counter DCNT to 0xFF indicating unlimited transfers.
It then uses a flag iface->manual_stop to manually issue the STOP
condition, once the required amount of bytes are received.

We found that on I2C receive operation issuing the STOP condition 
together with a FULL RCV FIFO (2bytes) will cause SDA and SCL be 
constantly driven low.

Temporary workaround until further investigation:
Discard the RCV FIFO before issuing the STOP condition.

Modified Paths

Diff

Modified: branches/2009R1/drivers/i2c/busses/i2c-bfin-twi.c (9011 => 9012)


--- branches/2009R1/drivers/i2c/busses/i2c-bfin-twi.c	2010-07-23 08:23:05 UTC (rev 9011)
+++ branches/2009R1/drivers/i2c/busses/i2c-bfin-twi.c	2010-07-23 08:25:03 UTC (rev 9012)
@@ -129,6 +129,10 @@
 			iface->transPtr++;
 			iface->readNum--;
 		} else if (iface->manual_stop) {
+			/* Avoid possible bus stall -
+			 * Flush FIFO before issuing the STOP condition
+			 */
+			read_RCV_DATA16(iface);
 			write_MASTER_CTL(iface,
 				read_MASTER_CTL(iface) | STOP);
 		} else if (iface->cur_mode == TWI_I2C_MODE_REPEAT &&
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to