提交 41101a33 编写于 作者: J Jean Delvare 提交者: Jean Delvare

i2c-algo-bit: Don't resched on clock stretching

Clock stretching is not supposed to last long, so asking to be
rescheduled while waiting for the clock line to be released by a slave
makes little sense. Odds are that the clock line will long have been
released when we run again, so we will have lost time and may even
get an SMBus timeout because of this.

So just busy-wait in that case. This also participates in the effort
to make i2c-algo-bit usable in contexts that can't sleep.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Cc: Ben Skeggs <bskeggs@redhat.com>
上级 5694f8a8
......@@ -112,7 +112,7 @@ static int sclhi(struct i2c_algo_bit_data *adap)
break;
return -ETIMEDOUT;
}
cond_resched();
cpu_relax();
}
#ifdef DEBUG
if (jiffies != start && i2c_debug >= 3)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册