]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
i2c-algo-bit: Fix timeout test
authorDave Airlie <airlied@redhat.com>
Tue, 5 May 2009 06:39:24 +0000 (08:39 +0200)
committerJean Delvare <khali@linux-fr.org>
Tue, 5 May 2009 06:39:24 +0000 (08:39 +0200)
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>
drivers/i2c/algos/i2c-algo-bit.c

index d420cc5f563313d81f1b0d2e816a9d44c98819ca..e25e13980af3543a7dea3b9a60ec61a64877631b 100644 (file)
@@ -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();
        }