Re: [PATCH] software node: allow referencing software nodes by name

From: Andy Shevchenko

Date: Thu Mar 26 2026 - 05:06:50 EST


On Thu, Mar 26, 2026 at 09:47:03AM +0100, Bartosz Golaszewski wrote:
> On Thu, Mar 26, 2026 at 9:39 AM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Thu, Mar 26, 2026 at 09:34:01AM +0100, Bartosz Golaszewski wrote:
> > > On Thu, Mar 26, 2026 at 9:27 AM Andy Shevchenko
> > > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > > > On Wed, Mar 25, 2026 at 05:32:06PM +0100, Bartosz Golaszewski wrote:
> > > > > On Tue, Mar 24, 2026 at 8:30 PM Dmitry Torokhov
> > > > > <dmitry.torokhov@xxxxxxxxx> wrote:
> > > > > >
> > > > > > Please post the reworked version so we can review all the details. My
> > > > > > concern was that it relies on notifier chains to notify when devices
> > > > > > get registered and unregistered, and instead of matching node names you
> > > > > > now need to somehow match device instances and software node instances,
> > > > > > which again likely is done based on some name. This just piles on
> > > > > > complexity where a simpler solution would be sufficient.
> > > > >
> > > > > I will post it. Hopefully before the end of the week. I want to cover
> > > > > both OF nodes with paz00 as well as ACPI with android tablets. The
> > > > > latter case will have to wait for devices because there's no way to
> > > > > look up an ACPI node by name that I could idenfity (correct me if I'm
> > > > > wrong).
> > > >
> > > > What do you need from ACPI exactly? The ACPI namespace in the OS is represented
> > > > by set of ACPI handles, each of which is the object pointing out to some object
> > > > in it. Any object in ACPI has a unique path. At any time, after parsing the
> > > > ACPI table(s) into ACPI namespace we may get a handle based on the path.
> > >
> > > DT is unflattened very early into the boot sequence. Is this the case
> > > for ACPI tables as well? Knowing the name of the device (HID + index,
> > > eg.: "INT33FF:00"), can I check if there's a corresponding ACPI node
> > > (of_find_by_path/name() in DT parlance)?
> >
> > I believe so. See how we find a GPIO chip in the gpiolib-acpi-core.c.
> > In the similar way you can try finding any object in ACPI namespace.
> >
> > But note, ":00" is part of device instance name, it's not available
> > in ACPI namespace. There we have HID, UID, et cetera, ":00" is pure
> > Linux kernel thingy.
>
> And how would the four instances of the cherryview pin controller be
> identified in ACPI? I've just created a dumy table with a single
> device, I don't know ACPI very well. Could you post an example .dsl
> here for testing?

They are identified in the driver by using HID + UID combination:

https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/pinctrl/intel/pinctrl-cherryview.c#L1757

https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/pinctrl/intel/pinctrl-cherryview.c#L273
https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/pinctrl/intel/pinctrl-cherryview.c#L367
https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/pinctrl/intel/pinctrl-cherryview.c#L412
https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/pinctrl/intel/pinctrl-cherryview.c#L412

In ASL it will be something like

Device (GPO1) {
Name (_HID, "INT33FF")
Name (_UID, "1")
}

--
With Best Regards,
Andy Shevchenko