On Fri, 18 Apr 2008, Wolfram Sang wrote: > On Fri, Apr 18, 2008 at 01:07:51AM -0700, Trent Piepho wrote: > > > So the loop tries the write for the first time, fails (which is perfectly > > acceptable), then sleeps for more than timeout jiffies. The timeout > > expires and the write is never tried again. > Ehrm, the conditions for the while loop are OR-ed not AND-ed. So, even if > time_before changes to false, 'retries < 3' will keep the loop running. > I think this minimum of three tries will also cover the other issues you > (correctly) mentioned.
Oh, of course. I had ignored the retries because it seemed like a bad idea. If the timeout is based on time, why does it matter how many tries there were? Still, if you want to wait at least 25 ms, on a HZ=1000 system you might wait only 3 ms. And on a HZ=100 system, you'll wait at least 60 ms when the timeout only needed to be 25 ms. _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
