i2c-bfin-twi: abort transfer is MEM bit is reset unexpectedly
authorSonic Zhang <sonic.zhang@analog.com>
Thu, 23 Jun 2011 21:07:54 +0000 (17:07 -0400)
committerBen Dooks <ben-linux@fluff.org>
Mon, 27 Jun 2011 22:06:48 +0000 (23:06 +0100)
commit4a65163e3b2190445c1d94daa21d09c5af604d97
treeb70b2f85cfbbc2885b7338d04223de00986dc141
parentaf4087e0e682df12bdffec5cfafc2fec9208716e
i2c-bfin-twi: abort transfer is MEM bit is reset unexpectedly

Sometimes, the first I2C transmit interrupt is not serviced in time (like
when higher priority interrupts take too long).  Since the RESTART bit is
not set before the next I2C clock, when the TWI handler is finally called,
the I2C session is aborted (MEM bit is reset) and both SMITSERV and MCOMP
int status bits are set.

So when this happens, abort the transfer.

Reported-by: Isabelle Leonardi <i.leonardi@detracom.fr>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
drivers/i2c/busses/i2c-bfin-twi.c