[PATCH v4 0/5] software node: provide support for fw_devlink

Bartosz Golaszewski posted 5 patches 1 week, 5 days ago
MAINTAINERS                             |   2 +
drivers/base/swnode.c                   |  79 ++++++++
drivers/base/test/Kconfig               |   5 +
drivers/base/test/Makefile              |   2 +
drivers/base/test/swnode-devlink-test.c | 337 ++++++++++++++++++++++++++++++++
drivers/gpio/gpiolib-kunit.c            | 291 ++++++++++++++++++++++++++-
include/kunit/fwnode.h                  |  29 +++
lib/kunit/Makefile                      |   1 +
lib/kunit/fwnode.c                      | 146 ++++++++++++++
9 files changed, 885 insertions(+), 7 deletions(-)
Re: [PATCH v4 0/5] software node: provide support for fw_devlink
Posted by Bartosz Golaszewski 1 week, 5 days ago
On Mon, 13 Jul 2026 13:14:43 +0200, Bartosz Golaszewski
<bartosz.golaszewski@oss.qualcomm.com> said:
> Currently only devicetree systems have their devices' probe ordered
> against their suppliers automatically by fw_devlink. Software nodes have
> lately been used extensively treewide to describe references to resource
> suppliers: most notably, the GPIO subsystem uses it in many places. Now
> that the conversion of "dangling" GPIO chip software nodes to using real
> links is almost done, it makes sense to ensure no needless probe
> deferrals by implementing the add_links() callback from the fwnode
> interface.
>
> This series extends software node support to use fw_devlink and adds test
> coverage for the new behaviour.
>
> Patch 1 adds new kunit helpers that will be used later on for test
> cases.
>
> Patch 2 implements software_node_add_links() modelled on
> of_fwnode_add_links(): for every reference property it resolves the
> supplier and links to it. There's no allowlist like in DT - a software
> node only carries a reference when its author explicitly wants one, so
> every reference is an intentional supplier dependency. Graph
> "remote-endpoint" references, unregistered supplier software nodes and
> self-references are skipped. It also mirrors the device pointer onto a
> secondary software node so fw_devlink can find the supplier device, and
> purges the fwnode links on release.
>
> Patches 3 and 5 add the tests: a kunit suite for the add_links() op
> itself and GPIO tests for a real-life use-case: a GPIO consumer
> referencing its provider via a software node.
>
> Patch 4 proposes to add myself as a reviewer of software nodes.
>
> Caveats: a supplier software node must be registered before the consumer
> device is added, If the swnode is registered after the consumer was added,
> add_links() has already run and set FWNODE_FLAG_LINKS_ADDED, so the late
> supplier is missed. Graph/remote- endpoint ordering is left out for now as
> well as there are no known users.
>
> Merging strategy: with an Ack from Kunit maintainers, the entire series
> can go through the driver core tree.
>

Just a clarification: patch 5/5 will conflict with current gpio/for-next so
this one would have to go through the GPIO tree. An immutable branch with
commits 1-4 would be great.

Bart
Re: (subset) [PATCH v4 0/5] software node: provide support for fw_devlink
Posted by Danilo Krummrich 1 week, 2 days ago
On Mon, 13 Jul 2026 13:14:43 +0200, Bartosz Golaszewski wrote:
> [PATCH v4 0/5] software node: provide support for fw_devlink

Applied, thanks!

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

[1/5] kunit: provide a set of fwnode-oriented helpers
      commit: 9fdbdb528488
[2/5] software node: add fw_devlink support
      commit: 37e586675993
[3/5] software node: add kunit tests for fw_devlink support
      commit: eecba5978729
[4/5] MAINTAINERS: add myself as reviewer of software node support
      commit: 122630406245

The patches are in the topic/swnode topic branch and will be merged into the
corresponding target branch soon.
Re: (subset) [PATCH v4 0/5] software node: provide support for fw_devlink
Posted by Danilo Krummrich 1 week, 2 days ago
On Wed Jul 15, 2026 at 11:28 PM CEST, Danilo Krummrich wrote:
> On Mon, 13 Jul 2026 13:14:43 +0200, Bartosz Golaszewski wrote:
>> [PATCH v4 0/5] software node: provide support for fw_devlink
>
> Applied, thanks!
>
>   Branch: topic/swnode
>   Tree:   git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
>
> [1/5] kunit: provide a set of fwnode-oriented helpers
>       commit: 9fdbdb528488
> [2/5] software node: add fw_devlink support
>       commit: 37e586675993
> [3/5] software node: add kunit tests for fw_devlink support
>       commit: eecba5978729
> [4/5] MAINTAINERS: add myself as reviewer of software node support
>       commit: 122630406245
>
> The patches are in the topic/swnode topic branch and will be merged into the
> corresponding target branch soon.

I will provide a signed tag once I have the 0-day result.

Thanks,
Danilo
Re: (subset) [PATCH v4 0/5] software node: provide support for fw_devlink
Posted by Danilo Krummrich 1 week, 1 day ago
On Wed Jul 15, 2026 at 11:30 PM CEST, Danilo Krummrich wrote:
> On Wed Jul 15, 2026 at 11:28 PM CEST, Danilo Krummrich wrote:
>> On Mon, 13 Jul 2026 13:14:43 +0200, Bartosz Golaszewski wrote:
>>> [PATCH v4 0/5] software node: provide support for fw_devlink
>>
>> Applied, thanks!
>>
>>   Branch: topic/swnode
>>   Tree:   git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
>>
>> [1/5] kunit: provide a set of fwnode-oriented helpers
>>       commit: 9fdbdb528488
>> [2/5] software node: add fw_devlink support
>>       commit: 37e586675993
>> [3/5] software node: add kunit tests for fw_devlink support
>>       commit: eecba5978729
>> [4/5] MAINTAINERS: add myself as reviewer of software node support
>>       commit: 122630406245
>>
>> The patches are in the topic/swnode topic branch and will be merged into the
>> corresponding target branch soon.
>
> I will provide a signed tag once I have the 0-day result.

https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/tag/?h=swnode-7.3-rc1

The changes are also in driver-core-next now, thanks!
Re: (subset) [PATCH v4 0/5] software node: provide support for fw_devlink
Posted by Bartosz Golaszewski 5 days, 13 hours ago
On Fri, 17 Jul 2026 15:49:55 +0200, Danilo Krummrich <dakr@kernel.org> said:
> On Wed Jul 15, 2026 at 11:30 PM CEST, Danilo Krummrich wrote:
>> On Wed Jul 15, 2026 at 11:28 PM CEST, Danilo Krummrich wrote:
>>> On Mon, 13 Jul 2026 13:14:43 +0200, Bartosz Golaszewski wrote:
>>>> [PATCH v4 0/5] software node: provide support for fw_devlink
>>>
>>> Applied, thanks!
>>>
>>>   Branch: topic/swnode
>>>   Tree:   git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
>>>
>>> [1/5] kunit: provide a set of fwnode-oriented helpers
>>>       commit: 9fdbdb528488
>>> [2/5] software node: add fw_devlink support
>>>       commit: 37e586675993
>>> [3/5] software node: add kunit tests for fw_devlink support
>>>       commit: eecba5978729
>>> [4/5] MAINTAINERS: add myself as reviewer of software node support
>>>       commit: 122630406245
>>>
>>> The patches are in the topic/swnode topic branch and will be merged into the
>>> corresponding target branch soon.
>>
>> I will provide a signed tag once I have the 0-day result.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/tag/?h=swnode-7.3-rc1
>
> The changes are also in driver-core-next now, thanks!
>

Pulled, thanks!

Bartosz