[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080510090801.74da049d@hyperion.delvare>
Date: Sat, 10 May 2008 09:08:01 +0200
From: Jean Delvare <khali@...ux-fr.org>
To: "Maciej W. Rozycki" <macro@...ux-mips.org>
Cc: David Brownell <david-b@...bell.net>, linux-mips@...ux-mips.org,
mgreer@...sta.com, rtc-linux@...glegroups.com,
Atsushi Nemoto <anemo@....ocn.ne.jp>,
linux-kernel@...r.kernel.org, i2c@...sensors.org, ab@...able.de
Subject: Re: [RFC][PATCH 4/4] RTC: SMBus support for the M41T80,
On Fri, 9 May 2008 22:22:11 +0100 (BST), Maciej W. Rozycki wrote:
> > > You can issue a block read of up to 5 bytes (6 if you add the PEC byte
> > > which is not interpreted by the controller in any way). And you can issue
> > > a block write of up to 4 bytes (5 with PEC). That's clearly not enough
> > > for the m41t81 let alone a generic implementation.
> >
> > Right. Possibly worth updating i2c-sibyte to be able to perform
> > those calls through the "smbus i2c_block" calls; but maybe not.
> > (Those calls aren't true SMBus calls, but many otherwise-SMBus-only
> > controllers can handle them, hence the i2c_smbus_* prefix.)
>
> I am not sure such a limited functionality is worth the hassle of making
> it available to clients in a reasonably clean way. How common an
> extension of this kind is among SMBus controllers? I would say if there
> are other controllers providing it (perhaps for a different range of
> transfer lengths) and clients benefitting from it, it might be worth
> adding it for this controller as well. Otherwise perhaps let's wait till
> somebody complains about the lack of this functionality?
The problem is that the interface for client drivers to query the
adapters capabilities is rather limited. There's just one bit for I2C
block read, so if an adapter has limitations in the size of requests it
can accept (beyond the traditional 32-byte limit that comes from SMBus)
it can't express it. This means that client drivers should expect
transaction requests to fail even if they checked that the transaction
type in question was supported. Most client drivers don't actually
expect that.
My advice would be to only bother implementing restricted support for a
transaction type if there's a big benefit in doing so. And then, double
check that all the client drivers that are likely to be used with the
adapter in question, are robust enough to deal with the restrictions
gracefully.
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists