Skip to content

Commit

Permalink
i2c-algo-bit: Fix timeout test
Browse files Browse the repository at this point in the history
When fetching DDC using i2c algo bit, we were often seeing timeouts
before getting valid EDID on a retry. The VESA spec states 2ms is the
DDC timeout, so when this translates into 1 jiffie and we are close
to the end of the time period, it could return with a timeout less than
2ms.

Change this code to use time_after instead of time_after_eq.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Dave Airlie authored and Jean Delvare committed May 5, 2009
1 parent 4ccc28f commit 0cdba07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/algos/i2c-algo-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ 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_eq(jiffies, start + adap->timeout))
if (time_after(jiffies, start + adap->timeout))
return -ETIMEDOUT;
cond_resched();
}
Expand Down

0 comments on commit 0cdba07

Please sign in to comment.