On Mon, 13 Jul 2026 13:14:43 +0200, Bartosz Golaszewski
<[email protected]> 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

Reply via email to