openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] Dynamic DT device nodes
@ 2021-10-07  0:09 Zev Weiss
  2021-10-07  0:09 ` [PATCH 1/9] sysfs: add sysfs_remove_bin_file_self() function Zev Weiss
                   ` (10 more replies)
  0 siblings, 11 replies; 33+ messages in thread
From: Zev Weiss @ 2021-10-07  0:09 UTC (permalink / raw)
  To: openbmc
  Cc: Krzysztof Wilczyński, Zev Weiss, Rafael J. Wysocki,
	Daniel Vetter, Jeremy Kerr, Francis Laniel, linux-aspeed,
	Frank Rowand, Andrey Konovalov, Alexey Dobriyan, devicetree,
	Kees Cook, Rob Herring, Jonathan Cameron, Dan Williams,
	linux-arm-kernel, Daniel Axtens, Andy Shevchenko, Andrew Jeffery,
	Greg Kroah-Hartman, Nick Desaulniers, linux-kernel,
	Andrew Morton, Heiner Kallweit

Hello,

This patch series is in some ways kind of a v2 for the "Dynamic
aspeed-smc flash chips via 'reserved' DT status" series I posted
previously [0], but takes a fairly different approach suggested by Rob
Herring [1] and doesn't actually touch the aspeed-smc driver or
anything in the MTD subsystem, so I haven't marked it as such.

To recap a bit of the context from that series, in OpenBMC there's a
need for certain devices (described by device-tree nodes) to be able
to be attached and detached at runtime (for example the SPI flash for
the host's firmware, which is shared between the BMC and the host but
can only be accessed by one or the other at a time).  To provide that
ability, this series adds support for a new common device-tree
property, a boolean "dynamic" that indicates that the device may come
and go at runtime.  When present on a node, the sysfs file for that
node's "status" property is made writable, allowing userspace to do
things like:

  $ echo okay > /sys/firmware/devicetree/.../status
  $ echo reserved > /sys/firmware/devicetree/.../status

to activate and deactivate a dynamic device.

Because it leans on the OF_DYNAMIC machinery internally, this
functionality will only work on busses that register for OF reconfig
notifications and handle them appropriately (presently platform, i2c,
and spi).  This series does not attempt to solve the "dynamic devices
further down the tree" problem [2]; my hope is that handling for OF
reconfig notifications can be extended to other families of devices
(e.g. individual MTD spi-nor flash chips) in the future.

The central change of the series is patch 6; patches 1-5 are various
small infrastructure bits and plumbing tweaks in preparation for #6;
patches 7-9 are Kconfig, documentation, and an inaugural use of the
new property in the ASRock e3c246d4i BMC device tree.

Note that this series requires the duplicate-declaration removal patch
that was recently merged in Rob's tree [3]; it changes one of the
duplicated declarations and hence will not compile without that patch
(because the declarations no longer match).

[0] https://lore.kernel.org/openbmc/20210929115409.21254-1-zev@bewilderbeest.net/
[1] https://lore.kernel.org/openbmc/CAL_JsqJH+b5oFuSP+KBLBsN5QTA6xASuqXJWXUaDkHhugXPpnQ@mail.gmail.com/
[2] https://lore.kernel.org/openbmc/20210929220038.GS17315@packtop/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/commit/?id=6663ae07d995f5fbe2988a19858b2f87e68cf929

Zev Weiss (9):
  sysfs: add sysfs_remove_bin_file_self() function
  sysfs: add growable flag to struct bin_attribute
  lib/string: add sysfs_buf_streq()
  of: add self parameter to __of_sysfs_remove_bin_file()
  of: add self parameter to of_update_property()
  of: add support for 'dynamic' DT property
  of: make OF_DYNAMIC selectable independently of OF_UNITTEST
  dt-bindings: document new 'dynamic' common property
  ARM: dts: aspeed: Add e3c246d4i BIOS flash device

 .../devicetree/bindings/common-properties.txt | 18 ++++
 .../boot/dts/aspeed-bmc-asrock-e3c246d4i.dts  | 23 ++++++
 drivers/of/Kconfig                            |  8 +-
 drivers/of/base.c                             |  7 +-
 drivers/of/dynamic.c                          |  2 +-
 drivers/of/kobj.c                             | 82 +++++++++++++++++--
 drivers/of/of_private.h                       |  6 +-
 fs/sysfs/file.c                               | 15 +++-
 include/linux/of.h                            |  7 +-
 include/linux/string.h                        |  1 +
 include/linux/sysfs.h                         |  2 +
 lib/string.c                                  | 34 ++++++++
 12 files changed, 187 insertions(+), 18 deletions(-)

-- 
2.33.0


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

end of thread, other threads:[~2021-10-11 17:36 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07  0:09 [PATCH 0/9] Dynamic DT device nodes Zev Weiss
2021-10-07  0:09 ` [PATCH 1/9] sysfs: add sysfs_remove_bin_file_self() function Zev Weiss
2021-10-07  5:23   ` Greg Kroah-Hartman
2021-10-07  5:58     ` Zev Weiss
2021-10-07  6:12       ` Greg Kroah-Hartman
2021-10-07  6:55         ` Zev Weiss
2021-10-07  0:09 ` [PATCH 2/9] sysfs: add growable flag to struct bin_attribute Zev Weiss
2021-10-07  0:09 ` [PATCH 3/9] lib/string: add sysfs_buf_streq() Zev Weiss
2021-10-07  0:09 ` [PATCH 4/9] of: add self parameter to __of_sysfs_remove_bin_file() Zev Weiss
2021-10-07  5:25   ` Greg Kroah-Hartman
2021-10-07  0:09 ` [PATCH 5/9] of: add self parameter to of_update_property() Zev Weiss
2021-10-07  5:26   ` Greg Kroah-Hartman
2021-10-07  0:09 ` [PATCH 6/9] of: add support for 'dynamic' DT property Zev Weiss
2021-10-08 18:51   ` Frank Rowand
2021-10-08 19:19     ` Frank Rowand
2021-10-11 13:58     ` Frank Rowand
2021-10-11 14:46       ` Frank Rowand
2021-10-11 17:35       ` Zev Weiss
2021-10-07  0:09 ` [PATCH 7/9] of: make OF_DYNAMIC selectable independently of OF_UNITTEST Zev Weiss
2021-10-08 19:01   ` Frank Rowand
2021-10-07  0:09 ` [PATCH 8/9] dt-bindings: document new 'dynamic' common property Zev Weiss
2021-10-07  5:26   ` Greg Kroah-Hartman
2021-10-07  6:03     ` Zev Weiss
2021-10-07  0:09 ` [PATCH 9/9] ARM: dts: aspeed: Add e3c246d4i BIOS flash device Zev Weiss
2021-10-07  2:46 ` [PATCH 0/9] Dynamic DT device nodes Florian Fainelli
2021-10-07  5:44   ` Zev Weiss
2021-10-07  7:04 ` Andy Shevchenko
2021-10-07  9:05   ` Zev Weiss
2021-10-07 10:31     ` Greg Kroah-Hartman
2021-10-07 15:41       ` Zev Weiss
2021-10-07 20:03         ` Rob Herring
2021-10-08  5:41           ` Greg Kroah-Hartman
2021-10-08 19:43           ` Frank Rowand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).