]> git.baikalelectronics.ru Git - kernel.git/commit
i2c-algo-bit: Fix spurious SCL timeouts under heavy load
authorVille Syrjala <syrjala@sci.fi>
Thu, 15 Mar 2012 17:11:05 +0000 (18:11 +0100)
committerJean Delvare <khali@endymion.delvare>
Thu, 15 Mar 2012 17:11:05 +0000 (18:11 +0100)
commit96f811a22932d359336fb7f64d4efa8bc553e643
treee1c6aa2b4788eec7e9e552b90be10cd4ae5333ef
parent4257b03a3c0fd7e110228118c589678e49c1df21
i2c-algo-bit: Fix spurious SCL timeouts under heavy load

When the system is under heavy load, there can be a significant delay
between the getscl() and time_after() calls inside sclhi(). That delay
may cause the time_after() check to trigger after SCL has gone high,
causing sclhi() to return -ETIMEDOUT.

To fix the problem, double check that SCL is still low after the
timeout has been reached, before deciding to return -ETIMEDOUT.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/algos/i2c-algo-bit.c