Changeset 5687 for lm-sensors/branches

Show
Ignore:
Timestamp:
03/18/09 10:33:04 (3 years ago)
Author:
khali
Message:

Patch from Roel Kluin, backported from Linux 2.6.
With a postfix decrement these timeouts reach -1 rather than 0, but
after the loop it is tested whether they have become 0.

As pointed out by Jean Delvare, the condition we are waiting for should
also be tested before the timeout. With the current order, you could
exit with a timeout error while the job is actually done.

Location:
lm-sensors/branches/lm-sensors-2.10
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-2.10/CHANGES

    r5686 r5687  
    55  File lm_sensors.lsm: Delete, don't advertise a legacy branch 
    66  File doc/developers/release_checklist: Skip mail to lsm 
     7  Module i2c-amd8111: Fix timeout handling (2.6 backport) 
    78  Module it87: Properly decode -128 degrees C (2.6 backport) 
    89  Program sensors-detect: Fix detection of older DS1621 
  • lm-sensors/branches/lm-sensors-2.10/kernel/busses/i2c-amd8111.c

    r4318 r5687  
    8080        int timeout = 500; 
    8181 
    82         while (timeout-- && (inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_IBF)) 
     82        while ((inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_IBF) && --timeout) 
    8383                udelay(1); 
    8484 
     
    9595        int timeout = 500; 
    9696 
    97         while (timeout-- && (~inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_OBF)) 
     97        while ((~inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_OBF) && --timeout) 
    9898                udelay(1); 
    9999