Re: [PATCH v6 3/3] nvmem: core: Expose cells through sysfs

From: Miquel Raynal
Date: Mon Jul 17 2023 - 12:41:25 EST


Hi Michael,

michael@xxxxxxxx wrote on Mon, 17 Jul 2023 14:24:45 +0200:

> Hi,
>
> > There is one limitation though: if a layout is built as a module but is
> > not properly installed in the system and loaded manually with insmod
> > while the nvmem device driver was built-in, the cells won't appear in
> > sysfs. But if done like that, the cells won't be usable by the built-in
> > kernel drivers anyway.
>
> What is the difference between manual loading with insmod and automatic
> module loading? Or is the limitation, layout as M and device driver as Y
> doesn't work?

The nvmem core uses usermodehelper to load the relevant layout
module, but that only works if the module was installed correctly (make
modules_install).

The limitation is:
* Any storage device driver that registers an nvmem interface =y (or =m
but loaded before the nvmem layout)
* The relevant nvmem layout =m *and* not installed with make
modules_install

If you see a way to workaround this, let me know, but there is no way
we can enforce Kconfig dependencies between storage drivers and nvmem
layouts IMHO.

Thanks,
Miquèl