Skip to content

Commit 41101a3

Browse files
Jean DelvareJean Delvare
authored andcommitted
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: Jean Delvare <khali@linux-fr.org> Cc: Ben Skeggs <bskeggs@redhat.com>
1 parent 5694f8a commit 41101a3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/i2c/algos/i2c-algo-bit.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int sclhi(struct i2c_algo_bit_data *adap)
112112
break;
113113
return -ETIMEDOUT;
114114
}
115-
cond_resched();
115+
cpu_relax();
116116
}
117117
#ifdef DEBUG
118118
if (jiffies != start && i2c_debug >= 3)

0 commit comments

Comments
 (0)