[i2c] [patch 2.6.24-rc1-git] i2c-algo-bit, don't yield()

Jean Delvare khali at linux-fr.org
Tue Nov 20 22:19:40 CET 2007


On Sun, 18 Nov 2007 18:11:51 -0800, David Brownell wrote:
> On Sunday 18 November 2007, Jean Delvare wrote:
> > Arguably, this difference between I2C and SMBus is not specific to
> > i2c-algo-bit so this documentation doesn't really belong to that file.
> 
> Doesn't hurt to have it there, though.  Plus, I find myself thinking
> that algo-bit is the best bet for a reference implementation, and is
> accordingly appropriate for being commented a bit better than most
> other i2c adapter code.  No other code is going to have any kind of
> close match to the bits-on-the-wire, and that's a very useful level
> at which to understand I2C.

Yes, I agree that i2c-algo-bit is a kind of reference implementation,
so it deserves additional documentation. Fine with me.

> > But if you insist on including it here (which is fine with me), I fail
> > to see why the same comment shouldn't go right before bit_doAddress.
> 
> Because bit_doAddress() calls try_address() to do its dirty work,
> and thus doesn't need another comment.  ;)

Typo in my comment, sorry. I meant "couldn't go", not "shouldn't go".
I.e. move the comment from try_address to bit_doAddress, delete the
former and save the reader (and the compiler) the extra indirection.

> > Same code as in i2c-algo-bit, and equally broken. That's one of the
> > reasons why I wanted to kill 10-bit addressing support some times ago.
> > 
> > Oh, on second look, I have to agree with you... even more broken than
> > i2c-algo-bit.
> 
> Yep ... especially broken, and not the same code at all.

Well, i2c-algo-bit and i2c-algo-pcf share(d) a good number of bugs in
the 10-bit addressing code. Enough to guarantee that the code was cut
and pasted.

> > At this level of brokenness, I'd suggest that we plain 
> > kill 10-bit addressing support from this driver; this happens to also
> > solve the retries issue, so all good.
> 
> So you want an updated patch scrubbing both mechanisms from algo-pcf?
> And not from algo-bit?  Or separate patches?

I've already posted a patch killing 10-bit addressing support in
i2c-algo-pcf. It also removed the initialization of .retries, as that
value was only used in the 10-bit addressing part, as you noticed
yourself. So no need for an additional patch.

For i2c-algo-bit, I'll take your patch and leave 10-bit support
untouched. It should be easier to fix if someone ever needs it.

-- 
Jean Delvare



More information about the i2c mailing list