[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1982d29ccb4e8c82cddfe0d86edc6072@milecki.pl>
Date: Thu, 28 Sep 2023 22:24:04 +0200
From: Rafał Miłecki <rafal@...ecki.pl>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Michael Walle <michael@...le.cc>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Robert Marko <robert.marko@...tura.hr>,
Luka Perkov <luka.perkov@...tura.hr>,
linux-kernel@...r.kernel.org, Randy Dunlap <rdunlap@...radead.org>,
Chen-Yu Tsai <wenst@...omium.org>,
Daniel Golle <daniel@...rotopia.org>
Subject: Re: [PATCH v10 1/3] nvmem: core: Rework layouts to become platform
devices
On 2023-09-22 19:48, Miquel Raynal wrote:
> Current layout support was initially written without modules support in
> mind. When the requirement for module support rose, the existing base
> was improved to adopt modularization support, but kind of a design flaw
> was introduced. With the existing implementation, when a storage device
> registers into NVMEM, the core tries to hook a layout (if any) and
> populates its cells immediately. This means, if the hardware
> description
> expects a layout to be hooked up, but no driver was provided for that,
> the storage medium will fail to probe and try later from
> scratch. Technically, the layouts are more like a "plus" and, even we
> consider that the hardware description shall be correct, we could still
> probe the storage device (especially if it contains the rootfs).
>
> One way to overcome this situation is to consider the layouts as
> devices, and leverage the existing notifier mechanism. When a new NVMEM
> device is registered, we can:
> - populate its nvmem-layout child, if any
> - try to modprobe the relevant driver, if relevant
> - try to hook the NVMEM device with a layout in the notifier
> And when a new layout is registered:
> - try to hook all the existing NVMEM devices which are not yet hooked
> to
> a layout with the new layout
> This way, there is no strong order to enforce, any NVMEM device
> creation
> or NVMEM layout driver insertion will be observed as a new event which
> may lead to the creation of additional cells, without disturbing the
> probes with costly (and sometimes endless) deferrals.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
I rebased & tested my patch converting U-Boot NVMEM device to NVMEM
layout on top of this. It worked!
Tested-by: Rafał Miłecki <rafal@...ecki.pl>
For reference what I used:
partitions {
partition-loader {
compatible = "brcm,u-boot";
partition-u-boot-env {
compatible = "nvmem-cells";
nvmem-layout {
compatible = "brcm,env";
base_mac_addr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
};
};
--
Rafał Miłecki
Powered by blists - more mailing lists