From: "Danilo Krummrich" <dakr@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Bartosz Golaszewski" <brgl@kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Linus Walleij" <linusw@kernel.org>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
<driver-core@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<linux-gpio@vger.kernel.org>,
"Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Subject: Re: [PATCH 1/2] driver core: provide device_match_fwnode_ext()
Date: Fri, 20 Feb 2026 16:43:21 +0100 [thread overview]
Message-ID: <DGJWKFUBSS0W.2AECDX36IMNAO@kernel.org> (raw)
In-Reply-To: <CAJZ5v0gM08=Zq-VMHX-RT78L=HDacbayM7=SoQ2di-Hsc2SB0w@mail.gmail.com>
On Fri Feb 20, 2026 at 1:08 PM CET, Rafael J. Wysocki wrote:
> Secondary fwnodes were not intended for device matching in the first
> place. The idea was to use them as a secondary supply of device
> properties that may be missing from the primary node (think of an ACPI
> device object accompanied by a software node supplying properties that
> cannot be derived from the former). They could be added by a driver
> after matching the primary node for the benefit of a generic
> framework.
>
> IMV, the example with children inheriting the fwnode from their parent
> where the user wants to add a different secondary node to each child
> doesn't really match the picture described above. At least it was not
> anticipated. The idea was to allow the parent's fwnode to be extended
> and then (possibly) inherited.
>
> That's why the secondary fwnode pointer is there under the primary one.
>
> So all of this goes beyond the original anticipated use of secondary
> fwnodes and it seems to be calling for a list of equivalent (not
> primary and secondary) fwnodes in struct device, but then of course
> there's the question about duplicate properties and whether or not the
> fwnode used for driver binding should be preferred (I don't see why
> not).
>
> Until all of this is resolved, I wouldn't even add a generic helper
> for matching secondary nodes. I'd just put this code directly into
> gpio_chip_match_by_fwnode() along with a big fat comment explaining
> why exactly secondary nodes need to be taken into account there.
I'm aware that secondary software nodes were originally intended to supply
missing properties only.
However, I wonder whether the capability to match against them isn't actually a
natural, unavoidable consequence of how software nodes can be used to bridge
(broken) connections between providers and consumers.
Or said differently, once PROPERTY_ENTRY_GPIO() - or more generically
PROPERTY_ENTRY_REF() - was introduced, it exposed secondary nodes within the
device graph, which subsystems have to consider.
IIUC, this is also the reason why gpiod_fwnode_lookup() [1] (which is eventually
called from gpiod_get()) has to consider secondary nodes.
So, if I'm not mistaken with the above, it seems fair to provide such a helper.
[1] https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/gpio/gpiolib.c#L4675
next prev parent reply other threads:[~2026-02-20 15:43 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 16:31 [PATCH 0/2] driver core: provide and use device_match_fwnode_ext() Bartosz Golaszewski
2026-02-19 16:31 ` [PATCH 1/2] driver core: provide device_match_fwnode_ext() Bartosz Golaszewski
2026-02-19 16:36 ` Greg Kroah-Hartman
2026-02-19 16:39 ` Bartosz Golaszewski
2026-02-19 16:50 ` Greg Kroah-Hartman
2026-02-19 16:54 ` Dmitry Torokhov
2026-02-19 21:15 ` Bartosz Golaszewski
2026-02-20 0:47 ` Dmitry Torokhov
2026-02-20 7:27 ` Andy Shevchenko
2026-02-20 11:06 ` Bartosz Golaszewski
2026-02-19 16:55 ` Danilo Krummrich
2026-02-19 19:27 ` Andy Shevchenko
2026-02-19 21:18 ` Bartosz Golaszewski
2026-02-20 0:21 ` Danilo Krummrich
2026-02-20 7:42 ` Andy Shevchenko
2026-02-20 11:21 ` Bartosz Golaszewski
2026-02-19 21:16 ` Bartosz Golaszewski
2026-02-19 19:58 ` Andy Shevchenko
2026-02-19 21:21 ` Bartosz Golaszewski
2026-02-20 7:36 ` Andy Shevchenko
2026-02-20 11:25 ` Bartosz Golaszewski
2026-02-20 12:08 ` Rafael J. Wysocki
2026-02-20 14:35 ` Bartosz Golaszewski
2026-02-20 14:49 ` Andy Shevchenko
2026-02-20 14:55 ` Rafael J. Wysocki
2026-02-20 15:43 ` Danilo Krummrich [this message]
2026-02-20 16:03 ` Rafael J. Wysocki
2026-02-19 16:31 ` [PATCH 2/2] gpiolib: use device_match_fwnode_ext() Bartosz Golaszewski
2026-02-19 17:32 ` [PATCH 0/2] driver core: provide and " Linus Walleij
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=DGJWKFUBSS0W.2AECDX36IMNAO@kernel.org \
--to=dakr@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.