[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200605105351.GA1118@plvision.eu>
Date: Fri, 5 Jun 2020 13:53:51 +0300
From: Vadym Kochan <vadym.kochan@...ision.eu>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Taras Chornyi <taras.chornyi@...ision.eu>
Subject: Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Hi Srinivas,
On Mon, Jun 01, 2020 at 01:27:49PM +0300, Vadym Kochan wrote:
> On Mon, Jun 01, 2020 at 10:13:05AM +0100, Srinivas Kandagatla wrote:
> >
> >
> > On 01/06/2020 10:03, Vadym Kochan wrote:
> > > > > +
> > > > > + nvmem = of_nvmem_device_get(np, NULL);
> > > > > + if (IS_ERR(nvmem))
> > > > > + return PTR_ERR(nvmem);
> > > > > +
> > > > TBH, this looks completely incorrect way to do this and misuse of nvmem
> > > > consumer interface.
> > > >
> > > > Ideally nvmem provider driver should populate "cells" in struct nvmem_config
> > > > after decoding them and then register nvmem provider.
> > > >
> > > > That should just work!
> > > >
> > > >
> > > > --srini
> > > But this is not nvmem provider but just describes the cells for any
> > > nvmem device, because ONIE uses special TLV structure on the nvmem
> > > device. So from the nvmem device point it is a consumer but provides the cells
> > > for the given device.
> >
> > That still falls under nvmem providers responsibility to parse these cells
> > before registering it.
> OK, I thought that it is legal to have separate nvmem driver which
> provides access to the device itself, and other driver which describes the
> layout of the cells which might be applicable to any nvmem.
>
> >
> > BTW, where is the provider driver for this in kernel ?
> >
> >
> > --srini
> >
> > >
> One of the example is atmel eeprom (at24), but there might be different
> devices.
>
> But can you please explain what is the technical/conceptual issue with
> this approach ?
>
> Thanks,
I just I'd like to clarify if there is a way it can be acceptable. The
problem is that there is TLV format which might be used on any nvmem
device which contains for example mac address which needs to be exposed
as nvmem cell. If to populate cells via nvmem_config then anyway I need
to parse these cells from the "target" nvmem device.
Thanks,
Powered by blists - more mailing lists