Changeset 5727

Show
Ignore:
Timestamp:
05/20/09 09:21:19 (5 years ago)
Author:
khali
Message:

Backport from a Linux 2.6 patch from David Airlie:

i2c-algo-bit: Fix timeout test

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.

Location:
i2c/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • i2c/trunk/CHANGES

    r5688 r5727  
    1212  doc/writing-clients: Cleanups (2.6 backport) 
    1313  i2c.h: Drop I2C_FUNC_SMBUS_*I2C_BLOCK_2 defines (2.6 backport) 
     14  i2c-algo-bit: Fix timeout test (2.6 backport) 
    1415  i2c-core: Drop Linux 2.4 incompatibility mode 
    1516            Fix misplaced parentheses (2.6 backport) 
  • i2c/trunk/kernel/i2c-algo-bit.c

    r4388 r5727  
    9696                 * while they are processing data internally.  
    9797                 */ 
    98                 if (time_after_eq(jiffies, start+adap->timeout)) { 
     98                if (time_after(jiffies, start + adap->timeout)) 
    9999                        return -ETIMEDOUT; 
    100                 } 
    101100                if (current->need_resched) 
    102101                        schedule();