[i2c] [PATCH] Add a new-style driver for most I2C EEPROMs
Trent Piepho
xyzzy at speakeasy.org
Sat Apr 19 01:06:14 CEST 2008
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.
More information about the i2c
mailing list