All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/8] nvmem: add block device NVMEM provider
@ 2024-03-05 20:23 Daniel Golle
  2024-03-05 20:23 ` [RFC PATCH v2 1/8] dt-bindings: block: add basic bindings for block devices Daniel Golle
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Daniel Golle @ 2024-03-05 20:23 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ulf Hansson,
	Jens Axboe, Daniel Golle, Dave Chinner, Jan Kara,
	Thomas Weißschuh, Christian Brauner, Li Lingfeng,
	Damien Le Moal, Min Li, Adrian Hunter, Hannes Reinecke,
	Christian Loehle, Avri Altman, Bean Huo, Yeqi Fu, Victor Shih,
	Christophe JAILLET, Ricardo B. Marliere, Greg Kroah-Hartman,
	devicetree, linux-kernel, linux-mmc, linux-block
  Cc: Diping Zhang, Jianhui Zhao, Jieying Zeng, Chad Monroe, Adam Fox,
	John Crispin

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.

Implement an NVMEM provider backed by block devices as typically the
NVMEM framework is used to have kernel drivers read and use binary data
from EEPROMs, efuses, flash memory (MTD), ...

In order to be able to reference hardware partitions on an eMMC, add code
to bind each hardware partition to a specific firmware subnode.

This series is meant to open the discussion on how exactly the device
tree schema for block devices and partitions may look like, and even
if using the block layer to back the NVMEM device is at all the way to
go -- to me it seemed to be a good solution because it will be reuable
e.g. for (normal, software GPT or MBR) partitions of an NVMe SSD.

This series has previously been submitted on July 19th 2023[1] and most of
the basic idea did not change since.

However, the recent introduction of bdev_file_open_by_dev() allow to
get rid of most use of block layer internals which supposedly was the
main objection raised by Christoph Hellwig back then.

Most of the other comments received for in the first RFC have also
been addressed, however, what remains is the use of class_interface
(lacking an alternative way to get notifications about addition or
removal of block devices from the system). As this has been criticized
in the past I'm specifically interested in suggestions on how to solve
this in another way -- ideally without having to implement a whole new
way for in-kernel notifications of appearing or disappearing block
devices...

And, in a way just like in case of MTD and UBI, I believe acting as an
NVMEM provider *is* a functionality which belongs to the block layer
itself and, other than e.g. filesystems, is inconvenient to implement
elsewhere.

[1]: https://patchwork.kernel.org/project/linux-block/list/?series=767565

Daniel Golle (8):
  dt-bindings: block: add basic bindings for block devices
  block: partitions: populate fwnode
  block: add new genhd flag GENHD_FL_NVMEM
  block: implement NVMEM provider
  dt-bindings: mmc: mmc-card: add block device nodes
  mmc: core: set card fwnode_handle
  mmc: block: set fwnode of disk devices
  mmc: block: set GENHD_FL_NVMEM

 .../bindings/block/block-device.yaml          |  22 +++
 .../devicetree/bindings/block/partition.yaml  |  51 +++++
 .../devicetree/bindings/block/partitions.yaml |  20 ++
 .../devicetree/bindings/mmc/mmc-card.yaml     |  45 +++++
 block/Kconfig                                 |   9 +
 block/Makefile                                |   1 +
 block/blk-nvmem.c                             | 175 ++++++++++++++++++
 block/partitions/core.c                       |  41 ++++
 drivers/mmc/core/block.c                      |   8 +
 drivers/mmc/core/bus.c                        |   2 +
 include/linux/blkdev.h                        |   2 +
 11 files changed, 376 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-nvmem.c

-- 
2.44.0

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-03-13 10:20 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05 20:23 [RFC PATCH v2 0/8] nvmem: add block device NVMEM provider Daniel Golle
2024-03-05 20:23 ` [RFC PATCH v2 1/8] dt-bindings: block: add basic bindings for block devices Daniel Golle
2024-03-06  7:22   ` Sascha Hauer
2024-03-06  7:32     ` Sascha Hauer
2024-03-07 14:51   ` Rob Herring
2024-03-11 19:40     ` [EXTERNAL] " Chad Monroe
2024-03-05 20:23 ` [RFC PATCH v2 2/8] block: partitions: populate fwnode Daniel Golle
2024-03-05 20:23 ` [RFC PATCH v2 3/8] block: add new genhd flag GENHD_FL_NVMEM Daniel Golle
2024-03-05 20:23 ` [RFC PATCH v2 4/8] block: implement NVMEM provider Daniel Golle
2024-03-06 12:00   ` Ricardo B. Marliere
2024-03-05 20:24 ` [RFC PATCH v2 5/8] dt-bindings: mmc: mmc-card: add block device nodes Daniel Golle
2024-03-05 20:24 ` [RFC PATCH v2 6/8] mmc: core: set card fwnode_handle Daniel Golle
2024-03-08  8:04   ` Avri Altman
2024-03-08 14:55     ` Daniel Golle
2024-03-05 20:24 ` [RFC PATCH v2 7/8] mmc: block: set fwnode of disk devices Daniel Golle
2024-03-05 20:24 ` [RFC PATCH v2 8/8] mmc: block: set GENHD_FL_NVMEM Daniel Golle
2024-03-12 12:22 ` [RFC PATCH v2 0/8] nvmem: add block device NVMEM provider Ulf Hansson
2024-03-12 12:30   ` Daniel Golle
2024-03-12 12:57     ` Ulf Hansson
2024-03-12 13:12       ` Daniel Golle
2024-03-13 10:19         ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.