Re: [PATCH v2 3/9] software node: allow referencing firmware nodes

From: Bartosz Golaszewski
Date: Fri Oct 24 2025 - 11:28:47 EST


On Fri, Oct 24, 2025 at 5:17 PM Sakari Ailus
<sakari.ailus@xxxxxxxxxxxxxxx> wrote:
>
> Hi Bartosz,
>
> On Wed, Oct 22, 2025 at 03:41:02PM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> >
> > At the moment software nodes can only reference other software nodes.
> > This is a limitation for devices created, for instance, on the auxiliary
> > bus with a dynamic software node attached which cannot reference devices
> > the firmware node of which is "real" (as an OF node or otherwise).
>
> That's not entirely true: you can add a software node as a secondary to an
> existing OF or ACPI fwnode. This has not been used widely and it's not very
> convenient to set up.

First: set_secondary_fwnode() API seems to require a struct device,
what if we don't have one yet? Unless you're talking about a different
interface.

Second: are we even allowed to modify an existing fwnode from a random
place in the kernel? I mean: I'm module X and there's an fwnode Y, I
don't know what it is. Can I just arbitrarily add a secondary node to
it?

>
> Additional properties in ACPI or OF nodes will still need the secondary
> node, after these patches.
>

That's not the goal of this series. Being able to create software
nodes that reference real devices. In this particular case: a software
node for the reset-gpio device that will allow it to resolve the
reference to the physical GPIO provider.

Bart