Question:Re: [patch] 2.5.25 I2C driver id and Config updates boundar
In my opinion all three numbers (udelay, mdelay{not used?], timeout) should be
absolute times, not related to jiffies.
I guess it's supposed to be 10 ms units for timeout.
udelay is obviously the half-clock time (i2c clock freq = 1,000,000 / (2
* udelay))
Whatever the answer is, we should put it as a comment in i2c-algo-bit.h. We do periodically get asked what the units for the 3 vaules are.
Most drivers have timeout = 100. That's 1 second. That's forever, as you have found out if you ever probed a stuck bus.
As Dori Eldar points out (see my mail from a couple of weeks ago, or TODO in i2c), i2c has no minimum frequency but smbus has a min. frequency of 10 kHz. There's no way to enforce that in i2c-algo-bit today. It would be nice to have some way to tell i2c-algo-bit to enforce SMBus timing rules.
What mechanism could be used to set a timeout
of 100 microsec?
Quoted 44 lines · Albert Cranford
Thanks for review. I'll pass your questions on to the group to clarify/answer.
The current I2C CVS tree looks like:
if (start+adap->timeout <= jiffies) { return -ETIMEDOUT; } but I think I was told not to submit the change since Linus's tree was correct. if (time_after_eq(jiffies, start+adap->timeout)) { return -ETIMEDOUT; }Albert
Quoted 15 lines · Petr Vandrovec
Quoted 5 lines · Albert Cranford
Hello Linus,
Could you please apply these 3 patches toward 2.5.26. They include Config.in updates, additions ini2c-id.hfor "Video for Linux" and a compatibility fix fori2c-algo-bit.cHi,
is timeout field ini2c_algo_bit_datasupposed to be in jiffies
(like it is currently used) or in 10ms units? If it is supposed to be in jiffies (other algos do not care about timeout field), there is dozen of places (all callers ofi2c_bit_add_bus) which get it wrong.Quoted 9 lines
Next suspicious thing is that 'timeout' field from
i2c_adapter
structure is not used at all - onlyi2c_controlis willing to set it, but nobody reads this field. Should noti2c_bit_add_buscopy its timeout into this field, and then useadap->timeoutinstead ofbitadap->timeoutin itssclhi()procedure?
Thanks,
Petr Vandrovec [email protected]--
Albert Cranford Deerfield Beach FL USA
[email protected]