• Jean Delvare's avatar
    [PATCH] I2C: Handle read errors in w83l785ts · 4f91cc15
    Jean Delvare authored
    Here is a patch that adds proper read error handling in the w83l785ts
    driver. This is needed for this driver because on many Asus boards the
    BIOS or something accesses the chip in our back and causes collisions or
    something similar that causes many read errors. For now, these errors
    make the driver return temperature values of -1 from times to times.
    
    I have been working with James Bolt on this. See the thread on the
    lm_sensors mailing list for details. The patch is fairly well tested. It
    is against 2.6.2-rc3 + your current stack of patches as I know it.
    
    The "retry until it works" method is the best I could think of, since we
    have no information from Asus and I don't expect to get any. If it still
    doesn't work after an arbitrary number (5) of tries it returns the
    previously known value and generates an error in the logs. James' tests
    showed that it will probably never happen though (highest retry count
    was 3 and happened once out of 3000 reads) unless we lower the arbitrary
    number (but we don't want to, do we?)
    
    I inserted incremental delays as reads fail, I felt like it should help
    avoid collisions with whatever-is-bugging-us. Seems to work OK, but it's
    not perfect (since we sometimes need 3 retries) and I didn't test with a
    different policy (no delay, constant delay or different increment).
    4f91cc15
w83l785ts.c 9.08 KB