i2c: bfin-twi: Read and write the FIFO in loop
authorSonic Zhang <sonic.zhang@analog.com>
Tue, 28 May 2013 10:41:09 +0000 (18:41 +0800)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 12 Jun 2013 18:39:07 +0000 (20:39 +0200)
commit8419c8debdc600b71fb89f0ffad80a6f436d80fe
tree5d0f1cfc0b37e7d00fa480ad77461a5af22b9683
parentc80f52847c50109ca248c22efbf71ff10553dca4
i2c: bfin-twi: Read and write the FIFO in loop

TWI transfer interrupts may be lost when system is heavily handling other
interrupts, while current transfer handler depends on each accurate interrupt
and misses some data in this case. Because there are 2 2-byte FIFOs in blackfin
TWI controller, the occurrence of the data loss can be reduced by reading till
the RX FIFO is empty and writing till the TX FIFO is full.

Reported-by: Bob Maris <mail@maris-ee.eu>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-bfin-twi.c