i2c: i2c-bfin-twi: Improve the patch for bug "Illegal i2c bus lock upon certain trans...
authorSonic Zhang <sonic.zhang@analog.com>
Wed, 13 Jun 2012 08:22:41 +0000 (16:22 +0800)
committerWolfram Sang <w.sang@pengutronix.de>
Fri, 13 Jul 2012 06:27:31 +0000 (08:27 +0200)
commita20a64d226be36808b24d2205b5d35e80c49e8be
tree577632d86b31b12fb51bb646e968367064b47e59
parent925594e03550f1825647ea5408a32bb9803d90f1
i2c: i2c-bfin-twi: Improve the patch for bug "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.

This patch stops receiving operation immediately in last rx interrupt.
This patch also wakes up waiting process when transfer completes.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
drivers/i2c/busses/i2c-bfin-twi.c