Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1210602 > unrolled thread
| Started by | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| First post | 2015-08-20 18:00 +0200 |
| Last post | 2015-08-21 00:00 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH RFC] eeprom: at24: extend driver to plug into the NVMEM framework Maxime Ripard <maxime.ripard@free-electrons.com> - 2015-08-20 18:00 +0200
Re: [PATCH RFC] eeprom: at24: extend driver to plug into the NVMEM framework Andrew Lunn <andrew@lunn.ch> - 2015-08-20 18:50 +0200
Re: [PATCH RFC] eeprom: at24: extend driver to plug into the NVMEM framework Maxime Ripard <maxime.ripard@free-electrons.com> - 2015-08-21 00:00 +0200
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2015-08-20 18:00 +0200 |
| Subject | Re: [PATCH RFC] eeprom: at24: extend driver to plug into the NVMEM framework |
| Message-ID | <pZApX-YM-3@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
On Mon, Aug 17, 2015 at 05:25:04PM +0200, Andrew Lunn wrote: > On Mon, Aug 17, 2015 at 03:59:23PM +0100, Srinivas Kandagatla wrote: > > > > > > On 17/08/15 14:09, Andrew Lunn wrote: > > >On Mon, Aug 17, 2015 at 02:01:24PM +0100, Srinivas Kandagatla wrote: > > >> > > >>+Adding Maxime in the loop > > >> > > >>On 16/08/15 16:37, Stefan Wahren wrote: > > >>>>>Another question which spring to mind is, do we want the eeprom to be > > >>>>>in /sys twice, the old and the new way? Backwards compatibility says > > >>>>>the old must stay. Do we want a way to suppress the new? Or should we > > >>>>>be going as far as refractoring the code into a core library, and two > > >>>>>wrapper drivers, old and new? > > >>>I think these are questions for the framework maintainers. > > >>> > > >>One of the reasons for the NVMEM framework is to remove that > > >>duplicate code in the every driver. There was no framework/ABI > > >>which was guiding such old eeprom sysfs entry in first place, so I > > >>dont see an issue in removing it for good. Correct me if am wrong. > > > > > >The reason for keeping it is backwards compatibility. Having the > > >contents of the EEPROM as a file in /sys via this driver is now a part > > >of the Linux ABI. You cannot argue it is not an ABI, just because > > >there is no framework. Userspace will be assuming it exists at the > > >specified location. So we cannot remove it, for existing uses of the > > >driver. > > Am Ok as long as someone is happy to maintain it. > > Wolfram Sang has been maintaining the AT24 driver since 2008. We need > his ACK to this change, and since this is an i2c driver, he is also > probably the path into mainline for this change. > > But we should also look at the bigger picture. The AT25, MAX6875 and > sunxi_sid drivers also have a binary file in /sys. It would be good to > have some sort of plan what to do with these drivers, even if at the > moment only AT24 is under discussion. It's true that this is something that we might have overlooked. Is it expected to maintain that compatibility when moving a driver from one framework to another (and this is a real question, not a troll)? If so, we might provide a compatibility layer to add the former file too, protected by a kconfig option maybe ? In the sunxi_sid case, I'm not sure anyone will really notice. It wasn't used for anything but debug at this point, but it will be noticed for the much more generic AT24 and At25 drivers. Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
[toc] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2015-08-20 18:50 +0200 |
| Message-ID | <pZBcn-290-13@gated-at.bofh.it> |
| In reply to | #1210602 |
> It's true that this is something that we might have overlooked. Is it
> expected to maintain that compatibility when moving a driver from one
> framework to another (and this is a real question, not a troll)?
Yes. There will be user space applications reading from the eeprom
file in /sys. In fact, until the NVMEM framework arrived, it was not
easy to access the eeprom from kernel space, meaning the majority of
users must of been user space...
> If so, we might provide a compatibility layer to add the former file
> too, protected by a kconfig option maybe ?
There is one other detail you might of missed. Both AT24 and AT25 do
have an in kernel API. In the at24_platform_data you can have a
callback function "setup" which gets called when the device is
probed. setup() is called with a struct memory_accessor which contains
function pointers for reading and writing to the EEPROM. A few
platforms use these for getting the MAC address out of the EEPROM.
And these platforms are old style, not DT.
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2015-08-21 00:00 +0200 |
| Message-ID | <pZG2p-G0-67@gated-at.bofh.it> |
| In reply to | #1210626 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Aug 20, 2015 at 06:38:51PM +0200, Andrew Lunn wrote: > > It's true that this is something that we might have overlooked. Is it > > expected to maintain that compatibility when moving a driver from one > > framework to another (and this is a real question, not a troll)? > > Yes. There will be user space applications reading from the eeprom > file in /sys. In fact, until the NVMEM framework arrived, it was not > easy to access the eeprom from kernel space, meaning the majority of > users must of been user space... Ack. > > If so, we might provide a compatibility layer to add the former file > > too, protected by a kconfig option maybe ? > > There is one other detail you might of missed. Both AT24 and AT25 do > have an in kernel API. In the at24_platform_data you can have a > callback function "setup" which gets called when the device is > probed. setup() is called with a struct memory_accessor which contains > function pointers for reading and writing to the EEPROM. A few > platforms use these for getting the MAC address out of the EEPROM. > And these platforms are old style, not DT. Actually, we took it into account. The in-kernel API is even a big chunk of the framework. The only thing we still need to figure out is what interface we need to register cells statically. AT25's memory accessor can be removed, there's no users for it. The only user of the AT24 is some omap l138 boards is mach-davinci. Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web