mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
fc29fd821d
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. Even if 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 native notifier mechanism. When a new NVMEM device is registered, we can populate its nvmem-layout child, if any, and wait for the matching to be done in order to get the cells (the waiting can be easily done with the NVMEM notifiers). If the layout driver is compiled as a module, it should automatically be loaded. 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. In order to achieve that goal we create a new bus for the nvmem-layouts with minimal logic to match nvmem-layout devices with nvmem-layout drivers. All this infrastructure code is created in the layouts.c file. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20231215111536.316972-7-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32 lines
543 B
Plaintext
32 lines
543 B
Plaintext
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
config NVMEM_LAYOUTS
|
|
bool
|
|
depends on OF
|
|
|
|
if NVMEM_LAYOUTS
|
|
|
|
menu "Layout Types"
|
|
|
|
config NVMEM_LAYOUT_SL28_VPD
|
|
tristate "Kontron sl28 VPD layout support"
|
|
select CRC8
|
|
help
|
|
Say Y here if you want to support the VPD layout of the Kontron
|
|
SMARC-sAL28 boards.
|
|
|
|
If unsure, say N.
|
|
|
|
config NVMEM_LAYOUT_ONIE_TLV
|
|
tristate "ONIE tlv support"
|
|
select CRC32
|
|
help
|
|
Say Y here if you want to support the Open Compute Project ONIE
|
|
Type-Length-Value standard table.
|
|
|
|
If unsure, say N.
|
|
|
|
endmenu
|
|
|
|
endif
|