diff options
author | Peter Swain <pswain@cavium.com> | 2016-04-25 16:33:37 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2016-04-26 23:19:40 +0200 |
commit | 1bb1ff3e7c74f4569dddf7bda8054a0bb6ed0073 (patch) | |
tree | 12265caac255409a81c8b2d36df39d7826f6d7b0 /drivers/i2c/busses/i2c-imx.c | |
parent | 392d01de2d2476e8a50cf30f049e369deaaea127 (diff) | |
download | op-kernel-dev-1bb1ff3e7c74f4569dddf7bda8054a0bb6ed0073.zip op-kernel-dev-1bb1ff3e7c74f4569dddf7bda8054a0bb6ed0073.tar.gz |
i2c: octeon: Improve performance if interrupt is early
There is a race between the TWSI interrupt and the condition
that is required before proceeding:
Low-level: interrupt flag bit must be set
High-level controller: valid bit must be clear
If the interrupt comes too early and the condition is not met
the wait will time out, and the transfer is aborted leading
to very poor performance.
To avoid this race retry for the condition ~80 µs later.
The retry is avoided on the very first invocation of
wait_event_timeout() (which tests the condition before entering
the wait and is therefore always wrong in this case).
EEPROM reads on 100kHz i2c now measure ~5.2kB/s, about 1/2 what's
achievable, and much better than the worst-case 100 bytes/sec before.
While at it remove the debug print from the low-level wait function.
Signed-off-by: Peter Swain <pswain@cavium.com>
Signed-off-by: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-imx.c')
0 files changed, 0 insertions, 0 deletions