[PATCH v4 0/2] driver core: make references to unregistered software nodes a special case

Bartosz Golaszewski posted 2 patches 2 months, 1 week ago
drivers/base/property.c       | 2 ++
drivers/base/swnode.c         | 2 +-
drivers/gpio/gpiolib-swnode.c | 8 ++++++++
3 files changed, 11 insertions(+), 1 deletion(-)
[PATCH v4 0/2] driver core: make references to unregistered software nodes a special case
Posted by Bartosz Golaszewski 2 months, 1 week ago
I spun this out of the bigger series (see: link to v2) in hopes that we
can get it in for v7.1 and make follow-up development easier next cycle.

This series proposes to make unregistered software nodes (ones that have
an address but which have not been passed to software_node_register()
yet) a special case with its dedicated error number. This will allow
subsystems to defer probe as if it was a firmware node not backed by
a device yet.

This is done in order to allow easier attaching of software nodes to
GPIO controllers and the removal of current label name matching against
the software node's name.

The patches can be picked up independently into driver core and GPIO
trees.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v4:
- Document the new error code in fwnode_get_reference_args()
- Simplify the logic in checking the new return value in GPIO code
- Link to v3: https://patch.msgid.link/20260403-swnode-unreg-retcode-v3-0-7886092b28b4@oss.qualcomm.com

Changes in v3:
- Drop x86 changes from the series (will be resubmitted later)
- Use -ENOTCONN instead of -ENXIO to indicate unregistered software
  nodes
- Fix retval check logic in gpiolib-swnode
- Link to v2: https://patch.msgid.link/20260402-baytrail-real-swnode-v2-0-6f5054a4cc07@oss.qualcomm.com

Changes in v2:
- Completely new approach
- Keep the cherryview and baytrail secondary fwnode handling as a
  driver-specific quirk for x86 tablets and don't introduce any new API
- Change the return value when resolving a reference to an unregistered
  software node and defer probe in GPIOLIB in that situation
- Export acpi_bus_type for use in x86-android-tablets
- Link to v1: https://patch.msgid.link/20260319-baytrail-real-swnode-v1-0-75f2264ae49f@oss.qualcomm.com

---
Bartosz Golaszewski (2):
      software node: return -ENOTCONN when referenced swnode is not registered yet
      gpio: swnode: defer probe on references to unregistered software nodes

 drivers/base/property.c       | 2 ++
 drivers/base/swnode.c         | 2 +-
 drivers/gpio/gpiolib-swnode.c | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)
---
base-commit: cc13002a9f984d37906e9476f3e532a8cdd126f5
change-id: 20260403-swnode-unreg-retcode-38b5b92eab28

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Re: (subset) [PATCH v4 0/2] driver core: make references to unregistered software nodes a special case
Posted by Danilo Krummrich 2 months ago
On Tue, 07 Apr 2026 15:27:56 +0200, Bartosz Golaszewski wrote:
> [PATCH v4 0/2] driver core: make references to unregistered software nodes a special case

Applied, thanks!

  Branch: driver-core-testing
  Tree:   git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git

[1/2] software node: return -ENOTCONN when referenced swnode is not registered yet
      commit: 84cb5edd3d2b

      [ Drop software node backend specifics from
        fwnode_property_get_reference_args() documentation. - Danilo ]

The patch will appear in the next linux-next integration (typically within 24
hours on weekdays.)

The patch is in the driver-core-testing branch and will be promoted to
driver-core-next after validation.
Re: (subset) [PATCH v4 0/2] driver core: make references to unregistered software nodes a special case
Posted by Bartosz Golaszewski 2 months ago
On Tue, 07 Apr 2026 15:27:56 +0200, Bartosz Golaszewski wrote:
> I spun this out of the bigger series (see: link to v2) in hopes that we
> can get it in for v7.1 and make follow-up development easier next cycle.
> 
> This series proposes to make unregistered software nodes (ones that have
> an address but which have not been passed to software_node_register()
> yet) a special case with its dedicated error number. This will allow
> subsystems to defer probe as if it was a firmware node not backed by
> a device yet.
> 
> [...]

Applied, thanks!

[2/2] gpio: swnode: defer probe on references to unregistered software nodes
      https://git.kernel.org/brgl/c/ca13ab654064fee86d6e7c9e87d0af7789561509

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>