i2c: omap: fix i207 errata handling
authorAlexander Kochetkov <al.kochet@gmail.com>
Fri, 21 Nov 2014 00:16:51 +0000 (04:16 +0400)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:05:23 +0000 (13:05 +0000)
commit5b616c16aebfda4c82ed5ab87e5a54cee40e14d2
tree66dda974792d2f91d1941582d2446b8cbc91e1ba
parentec9493ed004bed627f87ccfbed0880f695c2c7f0
i2c: omap: fix i207 errata handling

commit ccfc866356674cb3a61829d239c685af6e85f197 upstream.

commit 6d9939f651419a63e091105663821f9c7d3fec37 (i2c: omap: split out [XR]DR
and [XR]RDY) changed the way how errata i207 (I2C: RDR Flag May Be Incorrectly
Set) get handled. 6d9939f6514 code doesn't correspond to workaround provided by
errata.

According to errata ISR must filter out spurious RDR before data read not after.
ISR must read RXSTAT to get number of bytes available to read. Because RDR
could be set while there could no data in the receive FIFO.

Restored pre 6d9939f6514 way of handling errata.

Found by code review. Real impact haven't seen.
Tested on Beagleboard XM C.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Fixes: 6d9939f651419a63e09110 i2c: omap: split out [XR]DR and [XR]RDY
Tested-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-omap.c