block: preparations for NVMEM provider
Subsystems (3)
v4 cover block: preparations for NVMEM provider
On embedded devices using an eMMC it is common that one or more (hw/sw) partitions on the eMMC are used to store MAC addresses and Wi-Fi calibration EEPROM data.
Typically the NVMEM framework is used to have kernel drivers read and use binary data from EEPROMs, efuses, flash memory (MTD), ...
Using references to NVMEM bits in Device Tree allows the kernel to access and apply e.g. the Ethernet MAC address, which can be a requirement for userland to come up (e.g. for nfsroot).
The goal of this series is to prepare the block subsystem to allow for the implementation of an NVMEM provider similar to other types of non-volatile storage, so the same approach already used for EEPROMs, MTD (raw flashes) and UBI-managed NAND can also be used for devices storing those bits on an eMMC.
Define a device tree schema for block devices and partitions on them, which (similar to how it now works also for UBI volumes) can be matched by one or more properties.
Also add a simple notification API for other subsystems to be notified about additions and removals of block devices, which is going to be used by the block-backed NVMEM provider.
Overall, this enables uniform handling across practially all flash storage types used for this purpose (MTD, UBI, and soon also MMC or and in future maybe also other block devices).
---
Changes since v3 sent on Jun 26th, addressing comments from Jens Axboe:
- improve readability and error-handling in fwnode-matching code
- remove forgotten code from earlier development accessing ddev->parent
- use '#if defined' instead of '#ifdef' in header
- provide inline dummies in case of CONFIG_BLOCK_NOTIFIERS not being set
Changes since v2 sent on May 30th 2024 [1] addressing comments from Hauke Mehrtens (https://patchwork.kernel.org/comment/25892133/)
- Check length of UUID and PARTNAME.
- Remove forgotten fallback to get 'partitions' subnode from parent. It is no longer needed and was a left over from earlier development.
- Split series into 3 parts, one for each affected subsystem. This is the first part covering only the changes needed in the block subsystem. The second part adds the actual nvmem provider to drivers/nvmem/, the third part is going to make use of it for MMC block devices and cover changes in drivers/mmc.
Changes since v1 sent on March 21st 2024 [2]:
- introduce notifications for block device addition and removal for in-kernel users. This allows the nvmem driver to be built as a module and avoids using class_interface and block subsystem internals as suggested in https://patchwork.kernel.org/comment/25771998/ and
https://patchwork.kernel.org/comment/25770441/
This series has previously been submitted as RFC on July 19th 2023[3] and most of the basic idea did not change since. Another round of RFC was submitted on March 5th 2024[4].
[1]: https://patchwork.kernel.org/project/linux-block/list/?series=857192
[2]: https://patchwork.kernel.org/project/linux-block/list/?series=837150&archive=both
[3]: https://patchwork.kernel.org/project/linux-block/list/?series=767565
[4]: https://patchwork.kernel.org/project/linux-block/list/?series=832705
Daniel Golle (4):
dt-bindings: block: add basic bindings for block devices
block: partitions: populate fwnode
block: add support for notifications
block: add new genhd flag GENHD_FL_NVMEM
.../bindings/block/block-device.yaml | 22 +++++ .../devicetree/bindings/block/partition.yaml | 51 +++++++++++ .../devicetree/bindings/block/partitions.yaml | 20 +++++ block/Kconfig | 6 ++ block/Makefile | 1 + block/blk-notify.c | 87 +++++++++++++++++++ block/partitions/core.c | 70 +++++++++++++++ include/linux/blkdev.h | 13 +++ 8 files changed, 270 insertions(+) create mode 100644 Documentation/devicetree/bindings/block/block-device.yaml create mode 100644 Documentation/devicetree/bindings/block/partition.yaml create mode 100644 Documentation/devicetree/bindings/block/partitions.yaml create mode 100644 block/blk-notify.c
Signature · 1 line
2.45.2
PATCH v4 1/4 dt-bindings: block: add basic bindings for block devices
Add bindings for block devices which are used to allow referencing nvmem bits on them.
--- .../bindings/block/block-device.yaml | 22 ++++++++ .../devicetree/bindings/block/partition.yaml | 51 +++++++++++++++++++ .../devicetree/bindings/block/partitions.yaml | 20 ++++++++ 3 files changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/block/block-device.yaml create mode 100644 Documentation/devicetree/bindings/block/partition.yaml create mode 100644 Documentation/devicetree/bindings/block/partitions.yaml
Documentation/devicetree/bindings/block/block-device.yaml new file +22 -0
@@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/block/block-device.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: block storage device + +description: | + This binding is generic and describes a block-oriented storage device. + +maintainers: + - Daniel Golle <[email protected]> + +properties: + partitions: + $ref: /schemas/block/partitions.yaml + + nvmem-layout: + $ref: /schemas/nvmem/layouts/nvmem-layout.yaml# + +unevaluatedProperties: false
Documentation/devicetree/bindings/block/partition.yaml new file +51 -0
51 lines not on this page · raw message
Documentation/devicetree/bindings/block/partitions.yaml new file +20 -0
@@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/block/partitions.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Partitions on block devices + +description: | + This binding is generic and describes the content of the partitions container + node. + +maintainers: + - Daniel Golle <[email protected]> + +patternProperties: + "^block-partition-.+$": + $ref: partition.yaml + +unevaluatedProperties: false
Signature · 1 line
2.45.2
PATCH v4 2/4 block: partitions: populate fwnode
In reply to Daniel GolleLet block partitions to be represented by a firmware node and hence allow them to being referenced e.g. for use with blk-nvmem.
--- block/partitions/core.c | 70 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)
block/partitions/core.c +70 -0
@@ -10,6 +10,8 @@#include <linux/ctype.h> #include <linux/vmalloc.h> #include <linux/raid/detect.h> +#include <linux/property.h> +#include "check.h" static int (*const check_part[])(struct parsed_partitions *) = {
@@ -281,6 +283,72 @@ static ssize_t whole_disk_show(struct device *dev, } static const DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL); +static bool part_meta_match (const char *attr,const char *member,size_t length) +{ +/* check if length of attr exceeds specified maximum length */ +if (strnlen (attr, length) == length) +return false; + +/* return true if strings match */ +return !strncmp (attr, member, length); +} + +static struct fwnode_handle *find_partition_fwnode (struct block_device *bdev) +{ +struct fwnode_handle *fw_parts, *fw_part; +struct device *ddev =disk_to_dev (bdev->bd_disk); +const char *partname, *uuid; +u32 partno; +bool got_uuid, got_partname, got_partno; + + fw_parts =device_get_named_child_node (ddev,"partitions" ); +if (!fw_parts) +return NULL ; + +fwnode_for_each_child_node (fw_parts, fw_part) { + got_uuid = false; + got_partname = false; + got_partno = false; +/* +* In case 'uuid' is defined in the partitions firmware node require +* partition meta info being present and the specified uuid to match. +*/ + got_uuid = !fwnode_property_read_string (fw_part,"uuid" , &uuid); +if (got_uuid && (!bdev->bd_meta_info || + !part_meta_match (uuid, bdev->bd_meta_info->uuid, +PARTITION_META_INFO_UUIDLTH ))) +continue ; + +/* +* In case 'partname' is defined in the partitions firmware node require +* partition meta info being present and the specified volname to match. +*/ + got_partname = !fwnode_property_read_string (fw_part,"partname" , + &partname); +if (got_partname && (!bdev->bd_meta_info || + !part_meta_match (partname, + bdev->bd_meta_info->volname, +PARTITION_META_INFO_VOLNAMELTH ))) +continue ; + +/* +* In case 'partno' is defined in the partitions firmware node the +* specified partno needs to match. +*/ + got_partno = !fwnode_property_read_u32 (fw_part,"partno" , &partno); +if (got_partno &&bdev_partno (bdev) != partno) +continue ; + +/* Skip if no matching criteria is present in firmware node */ +if (!got_uuid && !got_partname && !got_partno) +continue ; + +return fw_part; + } + +return NULL ; +} +/* * Must be called either with open_mutex held, before a disk can be opened or * after all disk users are gone.
@@ -355,6 +423,8 @@ static struct block_device *add_partition(struct gendisk *disk, int partno, goto out_put; } +device_set_node (pdev,find_partition_fwnode (bdev)); +/* delay uevent until 'holders' subdir is created */ dev_set_uevent_suppress (pdev,1 ); err =device_add (pdev);
Signature · 1 line
2.45.2
Re: [PATCH v4 2/4] block: partitions: populate fwnode
block/partitions/core.c static ssize_t whole_disk_show(struct device *dev, · line 315
Quoted 4 lines · Daniel Golle
block/partitions/core.c +4
-0+/* +* In case 'uuid' is defined in the partitions firmware node require +* partition meta info being present and the specified uuid to match. +*/
Overly long lines, which is really annyoing for block comments.
block/partitions/core.c static ssize_t whole_disk_show(struct device *dev, · line 319
Quoted 4 lines
block/partitions/core.c +4
-0+ got_uuid = !fwnode_property_read_string (fw_part,"uuid" , &uuid); +if (got_uuid && (!bdev->bd_meta_info || + !part_meta_match (uuid, bdev->bd_meta_info->uuid, +PARTITION_META_INFO_UUIDLTH )))
Can we please not use the crazy part_meta stuff for anything new? We should never have merge it, and right now it is at least isolated to the boot time root dev_t partsing, and I'd really prefer to keep it in that corner.
Re: [PATCH v4 2/4] block: partitions: populate fwnode
Hi Christoph,
thank you for reviewing.
Quoted 7 lines · Christoph Hellwig
block/partitions/core.c static ssize_t whole_disk_show(struct device *dev, · line 315
Quoted 4 lines · Daniel Golle
block/partitions/core.c +4
-0+/* +* In case 'uuid' is defined in the partitions firmware node require +* partition meta info being present and the specified uuid to match. +*/ Overly long lines, which is really annyoing for block comments.
Should I use 80 chars as limit everywhere?
Quoted 11 lines
block/partitions/core.c static ssize_t whole_disk_show(struct device *dev, · line 319
Quoted 5 lines
block/partitions/core.c +4
-0+ got_uuid = !fwnode_property_read_string (fw_part,"uuid" , &uuid); +if (got_uuid && (!bdev->bd_meta_info || + !part_meta_match (uuid, bdev->bd_meta_info->uuid, +PARTITION_META_INFO_UUIDLTH )))Can we please not use the crazy
part_metastuff for anything new? We should never have merge it, and right now it is at least isolated to the boot time rootdev_tpartsing, and I'd really prefer to keep it in that corner.
At least up to my understanding there isn't any other to know a partitions UUID or volume name.
If there is another way to access this information I'd happily make use of it, but I couldn't find any.
Re: [PATCH v4 2/4] block: partitions: populate fwnode
Quoted 3 lines · Daniel Golle
Quoted 1 line
Overly long lines, which is really annyoing for block comments.
Should I use 80 chars as limit everywhere?
In my opinion that makes things easier. The coding style allows to exceed it for individual lines where it improves readability, which is a bit of an odd case.
Quoted 11 lines
Quoted 5 lines
Can we please not use the crazy
part_metastuff for anything new? We should never have merge it, and right now it is at least isolated to the boot time rootdev_tpartsing, and I'd really prefer to keep it in that corner.At least up to my understanding there isn't any other to know a partitions UUID or volume name.
If there is another way to access this information I'd happily make use of it, but I couldn't find any.
That is true, but except for the early dev_t parsing we actually never use these partition uuids in the kernel at all. Also in all the normal file system references either use the file system uuid, or the device provided one for devices that support them. Most of that is handled entirely in userspace, though - the kernel largely operates just on the dev_t.
PATCH v4 3/4 block: add support for notifications
In reply to Daniel GolleAdd notifier block to notify other subsystems about the addition or removal of block devices.
--- block/Kconfig | 6 +++ block/Makefile | 1 + block/blk-notify.c | 87 ++++++++++++++++++++++++++++++++++++++++++ include/linux/blkdev.h | 11 ++++++ 4 files changed, 105 insertions(+) create mode 100644 block/blk-notify.c
block/Kconfig +6 -0
@@ -209,6 +209,12 @@ config BLK_INLINE_ENCRYPTION_FALLBACK by falling back to the kernel crypto API when inline encryption hardware is not present. +config BLOCK_NOTIFIERS + bool "Enable support for notifications in block layer" + help + Enable this option to provide notifiers for other subsystems + upon addition or removal of block devices. + source "block/partitions/Kconfig" config BLK_MQ_PCI
block/Makefile +1 -0
@@ -38,3 +38,4 @@ obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += blk-crypto.o blk-crypto-profile.o \ blk-crypto-sysfs.o obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o obj-$(CONFIG_BLOCK_HOLDER_DEPRECATED) += holder.o +obj-$(CONFIG_BLOCK_NOTIFIERS) += blk-notify.o
block/blk-notify.c new file +87 -0
87 lines not on this page · raw message
include/linux/blkdev.h +11 -0
@@ -1687,4 +1687,15 @@ static inline bool bdev_can_atomic_write(struct block_device *bdev)#define DEFINE_IO_COMP_BATCH (name) struct io_comp_batch name = { } + +#define BLK_DEVICE_ADD 1 +#define BLK_DEVICE_REMOVE 2 +#if defined(CONFIG_BLOCK_NOTIFIERS ) +void blk_register_notify (struct notifier_block *nb); +void blk_unregister_notify (struct notifier_block *nb); +#else +static inline void blk_register_notify (struct notifier_block *nb) { }; +static inline void blk_unregister_notify (struct notifier_block *nb) { }; +#endif +#endif /* _LINUX_BLKDEV_H */
Signature · 1 line
2.45.2
Re: [PATCH v4 3/4] block: add support for notifications
Quoted 2 lines · Daniel Golle
Add notifier block to notify other subsystems about the addition or removal of block devices.
Notification for what? I really hate the concept of random modular code being able to hook into device discovery / partition scanning. And not actually having a user for it is a complete no-go.
Re: [PATCH v4 3/4] block: add support for notifications
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Daniel Golle
Add notifier block to notify other subsystems about the addition or removal of block devices.
Notification for what? I really hate the concept of random modular code being able to hook into device discovery / partition scanning.
Adding a dedicated notification interface (instead of using block internals in the nvmem driver) has been requested in a previous review by Bart Van Assche:
https://patchwork.kernel.org/comment/25771998/
Quote from that previous review comment:
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines
Why to add this functionality to the block layer instead of somewhere in the
drivers/directory?Simply because we need notifications about appearing and disappearing block devices, or a way to iterate over all block devices in a system. For both there isn't currently any other interface than using a
class_interfacefor that, and that requires access to&block_classwhich is considered a block subsystem internal.
Quoted 3 lines
That's an argument for adding an interface to the block layer that implements this functionality but not for adding this code in the block layer.
---
So that's what I did consequently. Using the notification interface the NVMEM driver can live in drivers/nvmem/ and doesn't need to be using block internals.
Quoted 2 lines
And not actually having a user for it is a complete no-go.
The user will be the nvmem provider, you can see the code in earlier versions of the patchset where I had included it:
Being another subsystem I thought it'd be better to deal with the block related things first, and once that has been sorted out I will move on to add the NVMEM driver and make the necessary changes for using it on eMMC.
Thank you for taking a look at this. Let me know if anything else is not clear or needs to be changed.
Cheers
Daniel
Re: [PATCH v4 3/4] block: add support for notifications
Quoted 10 lines · Daniel Golle
So that's what I did consequently. Using the notification interface the NVMEM driver can live in
drivers/nvmem/and doesn't need to be using block internals.Quoted 2 lines
And not actually having a user for it is a complete no-go.
The user will be the nvmem provider, you can see the code in earlier versions of the patchset where I had included it:
Quoted 6 lines
Being another subsystem I thought it'd be better to deal with the block related things first, and once that has been sorted out I will move on to add the NVMEM driver and make the necessary changes for using it on eMMC.
It is rather hard to review an interface without the users.
I still dislike the idea of notifications from bdev discovery / partition scanning into the users of them. We have one such users in the MD legacy autodetect code, but that has largely been considered at bad idea and distros tend to use mdadm based assembly from initramfs instead. Which IMHO feels like the right thing for nvmem as well, just have an nvmem provider that opens a file for a user provided path and use kernel_read on it. This can covered block devices, character devices and even regular files. It will require initramfs support, but that is pretty much used everywhere for storage discovery and setup anyway.
Re: [PATCH v4 3/4] block: add support for notifications
Hi Christoph,
Quoted 11 lines · Christoph Hellwig
Quoted 10 lines · Daniel Golle
So that's what I did consequently. Using the notification interface the NVMEM driver can live in
drivers/nvmem/and doesn't need to be using block internals.Quoted 2 lines
And not actually having a user for it is a complete no-go.
The user will be the nvmem provider, you can see the code in earlier versions of the patchset where I had included it:
Quoted 8 lines
Quoted 6 lines
Being another subsystem I thought it'd be better to deal with the block related things first, and once that has been sorted out I will move on to add the NVMEM driver and make the necessary changes for using it on eMMC.
It is rather hard to review an interface without the users.
I understand that, please take a look at previous iterations of this very series or use the link to the patch which I have sent before (see above).
Quoted 11 lines
I still dislike the idea of notifications from bdev discovery / partition scanning into the users of them. We have one such users in the MD legacy autodetect code, but that has largely been considered at bad idea and distros tend to use mdadm based assembly from initramfs instead. Which IMHO feels like the right thing for nvmem as well, just have an nvmem provider that opens a file for a user provided path and use
kernel_readon it. This can covered block devices, character devices and even regular files. It will require initramfs support, but that is pretty much used everywhere for storage discovery and setup anyway.
The problem there is that then we cannot use Device Tree to device the NVMEM layouts, and reference NVMEM bits to the dirvers which need them. Hence also the definition of the NVMEM layout would have to happen in userspace, inside an initramfs. I know that having an initramfs is common for classic desktop or server distributions, but the same is not true on more simple embedded devices such as router/firewall or WiFi access point appliances running OpenWrt.
Carrying all that board-specific knowledge in the form of scripts identifying the board is not exactly nice, nor is creating an individual initramfs for each of the 1000+ boards supported by OpenWrt, for example. Extracting the layout information from /sys/firmware/devicetree in userspace just to then somehow use libblkid to identify the block device and throw that information back at the kernel which requested it e.g. using a firmware hotplug call is an option, but imho an unnecessary complication. And obviously it would still prevent things like nfsroot (which requires the MAC address and potentially a WiFi calibration data to be setup) from working out of the box.
Doing the detour via userspace only for devices with an eMMC would be different from how it is done for any other type of backing storage such as simple I2C EEPROMs, (SPI-)flashes or UBI volumes.
Having a unified approach for all of them would make things much more convenient, as typically the actual layouts are even the same and can be reused accross devices of the same vendor. GL-iNet or ASUS router devices are a good example for that: The more high-end ones come with an eMMC and use the same NVMEM layout inside a GPT partition than mid-field devices on SPI-NAND or UBI, and older and/or lower-end devices on an SPI-NOR flash MTD partition.
To better understand the situation, maybe look at a few examples for which we are currently already using this patchset downstream at OpenWrt:
Inside a GPT partition on an eMMC:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/mediatek/dts/mt7981b-unielec-u7981-01-emmc.dts;h=abd4d4e59d74cc0d24e8c9e10e16c0859844e003;hb=HEAD#l39
On raw SPI-NAND (already possible with vanilla Linux):
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/mediatek/dts/mt7981b-unielec-u7981-01-nand.dts;h=230a612a34f7d370eb09e92284950d9949bf10cd;hb=HEAD#l45
Inside a UBI volume (also already possible with vanilla Linux):
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts;h=e40602fa215e1a677b534c85b767e824af041518;hb=HEAD#l255
Inside the boot hwpartition of the eMMC:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts;h=15818a90fca02955879d1bcca55ba2153e390621;hb=HEAD#l156
Inside a GPT partition on an eMMC:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts;h=fd0e1a69157ed0f27c32376aabab0fcc85ce23b9;hb=HEAD#l317
Those are just the examples I have been working on myself, so it was easy to come up with them. There are also ASUS devices with Qualcomm SoC using the same layout as the MediaTek-based devices inside a UBI volume.
Once a unified way to describe the loaction of the NVMEM bits is also present in upstream Linux, all those downstream device trees could be submitted for inclusion in Linux, and one could install a general-purpose OS like Debian **which wouldn't need to know anything about the details of where to read MAC addresses or calibration data from**, all hardware-specific knowledge would reside in DT.
The failure of defining this in a nice way results in very ugly situations such as distributions carrying the (board-specific!) calibration data for very few but very common single-board computers like the RaspberryPi in their rootfs or even in initramfs. Each distribution with a different level of hacks to give them individual MAC addresses and to load the correct file... And while this doesn't look so bad for systems which anyway come only with removable microSD storage, it **does* get ugly when it comes to systems which do store that information on their eMMC (typically "appliances" rather than SBCs meant for tinkerers).
Please take all that into consiration and also note that obviously, on systems not making use of any of that, you may simple not enable CONFIG_BLOCK_NOTIFIERS -- other than in previous iterations of the patchset this is all completely optional now.
Cheers
Daniel
Re: [PATCH v4 3/4] block: add support for notifications
Quoted 7 lines · Daniel Golle
The problem there is that then we cannot use Device Tree to device the NVMEM layouts, and reference NVMEM bits to the dirvers which need them. Hence also the definition of the NVMEM layout would have to happen in userspace, inside an initramfs. I know that having an initramfs is common for classic desktop or server distributions, but the same is not true on more simple embedded devices such as router/firewall or WiFi access point appliances running OpenWrt.
Maybe it needs to become more common so that we don't need crazy kernel workarounds for something that can be trivially done with a few lines of userspace code?
PATCH v4 4/4 block: add new genhd flag GENHD_FL_NVMEM
In reply to Daniel GolleAdd new flag to destinguish block devices which may act as an NVMEM provider.
--- include/linux/blkdev.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/blkdev.h +2 -0
@@ -81,11 +81,13 @@ struct partition_meta_info {* ``GENHD_FL_NO_PART``: partition support is disabled. The kernel will not * scan for partitions from add_disk, and users can't add partitions manually. * +* ``GENHD_FL_NVMEM``: the block device should be considered as NVMEM provider. */ enum {GENHD_FL_REMOVABLE =1 <<0 ,GENHD_FL_HIDDEN =1 <<1 ,GENHD_FL_NO_PART =1 <<2 , +GENHD_FL_NVMEM =1 <<3 , };enum {
Signature · 1 line
2.45.2
Jens Axboe
maintainerQuoted 21 lines · Daniel Golle
On embedded devices using an eMMC it is common that one or more (hw/sw) partitions on the eMMC are used to store MAC addresses and Wi-Fi calibration EEPROM data.
Typically the NVMEM framework is used to have kernel drivers read and use binary data from EEPROMs, efuses, flash memory (MTD), ...
Using references to NVMEM bits in Device Tree allows the kernel to access and apply e.g. the Ethernet MAC address, which can be a requirement for userland to come up (e.g. for nfsroot).
The goal of this series is to prepare the block subsystem to allow for the implementation of an NVMEM provider similar to other types of non-volatile storage, so the same approach already used for EEPROMs, MTD (raw flashes) and UBI-managed NAND can also be used for devices storing those bits on an eMMC.
Define a device tree schema for block devices and partitions on them, which (similar to how it now works also for UBI volumes) can be matched by one or more properties.
Quoted 7 lines
Also add a simple notification API for other subsystems to be notified about additions and removals of block devices, which is going to be used by the block-backed NVMEM provider.
Overall, this enables uniform handling across practially all flash storage types used for this purpose (MTD, UBI, and soon also MMC or and in future maybe also other block devices).
2-4 look fine to me now, but I don't know anything about the device bindings so someone qualified should review that before it gets queued up.
Signature · 1 line
Jens Axboe