mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Danilo Krummrich <dakr@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-acpi@vger.kernel.org, driver-core@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] software node: allow referencing software nodes by name
Date: Thu, 26 Mar 2026 21:01:24 +0200	[thread overview]
Message-ID: <acWChJZK-xwpuTZM@ashevche-desk.local> (raw)
In-Reply-To: <CAMRc=MdrxYRhB3MWnhTPM9FqzF-_P7Br5mRJ7kYOxQ2G3zjdow@mail.gmail.com>

On Thu, Mar 26, 2026 at 04:47:00PM +0100, Bartosz Golaszewski wrote:
> On Thu, Mar 26, 2026 at 9:48 AM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Thu, Mar 26, 2026 at 10:39:09AM +0200, Andy Shevchenko wrote:
> > > On Thu, Mar 26, 2026 at 09:34:01AM +0100, Bartosz Golaszewski wrote:

...

> > > 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.
> >
> > We have acpi_dev_present(), but if you read its kernel-doc, it suggests
> > to use acpi_get_devices() for the case of early checks (before device
> > are actually being instantiated).
> 
> Ah, but I'm seeing that the firmware node handle of the acpi device is
> part of struct acpi_device and is only initialized during the scanning
> phase which happens at subsys_initcall() time?

Sounds correct. With that you can just check the device presence in the table
and maybe evaluate the status (but I'm not sure about the latter).

> When using
> acpi_get_devices() you have an abstract handle and no fwnode for which
> to assign the secondary node yet, right?

You have no fwnode concept in ACPI namespace. It's Linux thingy.
So, yes, until you have a companion device (ACPI device as object of
struct acpi_device), you have fwnode, without that device, there is
no fwnode.

> It's not like with DT where there already is an instance of struct
> device_node to which you can assign the secondary fwnode even if its
> device doesn't exist yet.

Yeah DT in this sense is available earlier because they are just
static data. ACPI needs an interpreter and hence some preparations
to be done before full access to the namespace will be available.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-26 19:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  4:46 Dmitry Torokhov
2026-03-24  7:59 ` Greg Kroah-Hartman
2026-03-24 16:25   ` Dmitry Torokhov
2026-03-24  9:46 ` Bartosz Golaszewski
2026-03-24 19:30   ` Dmitry Torokhov
2026-03-25 16:32     ` Bartosz Golaszewski
2026-03-25 18:11       ` Dmitry Torokhov
2026-03-26  8:26       ` Andy Shevchenko
2026-03-26  8:28         ` Andy Shevchenko
2026-03-26  8:34         ` Bartosz Golaszewski
2026-03-26  8:39           ` Andy Shevchenko
2026-03-26  8:47             ` Bartosz Golaszewski
2026-03-26  9:03               ` Andy Shevchenko
2026-03-26  8:48             ` Andy Shevchenko
2026-03-26 15:47               ` Bartosz Golaszewski
2026-03-26 19:01                 ` Andy Shevchenko [this message]
2026-03-31 12:18                   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acWChJZK-xwpuTZM@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=brgl@kernel.org \
    --cc=dakr@kernel.org \
    --cc=djrscally@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®