From 64873d2e8c091db9e4e7643271fc3336e16eb7b5 Mon Sep 17 00:00:00 2001 From: Ville Syrjala Date: Sat, 21 May 2011 14:25:04 +0300 Subject: [PATCH] i2c-algo-bit: Avoid timeouts from preempt Signed-off-by: Ville Syrjala --- drivers/i2c/algos/i2c-algo-bit.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index d6d5868..674273d 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c @@ -103,7 +103,8 @@ static int sclhi(struct i2c_algo_bit_data *adap) * chips may hold it low ("clock stretching") while they * are processing data internally. */ - if (time_after(jiffies, start + adap->timeout)) + if (time_after(jiffies, start + adap->timeout) && + !getscl(adap)) return -ETIMEDOUT; cond_resched(); } -- 1.7.3.4