From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>, Lee Jones <lee@kernel.org>,
Pavel Machek <pavel@kernel.org>, Peter Rosin <peda@axentia.se>,
Heiner Kallweit <hkallweit1@gmail.com>,
Moritz Fischer <mdf@kernel.org>, Xu Yilun <yilun.xu@intel.com>,
Tom Rix <trix@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-phy@lists.infradead.org, linux-spi@vger.kernel.org,
linux-leds@vger.kernel.org, linux-fpga@vger.kernel.org,
driver-core@lists.linux.dev
Subject: Re: [PATCH net-next 07/10] net: phy: switch to using class_find_device_by_fwnode()
Date: Mon, 23 Mar 2026 11:33:36 -0700 [thread overview]
Message-ID: <acGGWTmSMuc5h3Od@google.com> (raw)
In-Reply-To: <acEBCBgMV3RrGKiU@shell.armlinux.org.uk>
On Mon, Mar 23, 2026 at 08:59:52AM +0000, Russell King (Oracle) wrote:
> On Sun, Mar 22, 2026 at 10:17:15PM -0700, Dmitry Torokhov wrote:
> > On Mon, Mar 23, 2026 at 03:54:09AM +0100, Andrew Lunn wrote:
> > > > - d = class_find_device_by_of_node(&mdio_bus_class, mdio_bus_np);
> > > > + d = class_find_device_by_fwnode(&mdio_bus_class,
> > > > + of_fwnode_handle(mdio_bus_np));
> > >
> > > When you look at this, why is it better?
> >
> > I think we should move as much as possible towards firmware-agnostic
> > APIs and use fwnode_handle instead of device_node or software_node or
> > ACPI companion. To discourage this I think we better remove
> > firmware-specific APIs where we have firmware-agnostic ones and
> > eventually clean up drivers that use OF- or ACPI-specific APIs.
>
> Basically, no. This is wrong.
>
> It may sound like a good goal, but there's an underlying issue. This
> goal assumes that the firmware description in OF and ACPI are
> indentical.
If they are different then drivers will make allowance for this, like
I2C core or SPI core does. But most of the modern drivers use
firmware-agnostic APIs (device_property_*()).
ACPI has allowance for device tree properties (via PRP0001 HID
entries), and drivers should work with them.
>
> Sure, looking up devices by fwnode handle makes sense, but looking up
> anything that is described in firmware is not suitable for this kind
> of conversion, because in doing so, you effectively "port" the DT
> bindings to ACPI, and it may not be suitable for ACPI.
>
> So, please don't make wholesale changes that transfer the DT bindings
> into ACPI.
>
I am not "transferring" anything, but I want to make sure the code works
even if we augment OF with software nodes or if DT properties are used
in ACPI.
Thanks.
--
Dmitry
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>, Lee Jones <lee@kernel.org>,
Pavel Machek <pavel@kernel.org>, Peter Rosin <peda@axentia.se>,
Heiner Kallweit <hkallweit1@gmail.com>,
Moritz Fischer <mdf@kernel.org>, Xu Yilun <yilun.xu@intel.com>,
Tom Rix <trix@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-phy@lists.infradead.org, linux-spi@vger.kernel.org,
linux-leds@vger.kernel.org, linux-fpga@vger.kernel.org,
driver-core@lists.linux.dev
Subject: Re: [PATCH net-next 07/10] net: phy: switch to using class_find_device_by_fwnode()
Date: Mon, 23 Mar 2026 11:33:36 -0700 [thread overview]
Message-ID: <acGGWTmSMuc5h3Od@google.com> (raw)
In-Reply-To: <acEBCBgMV3RrGKiU@shell.armlinux.org.uk>
On Mon, Mar 23, 2026 at 08:59:52AM +0000, Russell King (Oracle) wrote:
> On Sun, Mar 22, 2026 at 10:17:15PM -0700, Dmitry Torokhov wrote:
> > On Mon, Mar 23, 2026 at 03:54:09AM +0100, Andrew Lunn wrote:
> > > > - d = class_find_device_by_of_node(&mdio_bus_class, mdio_bus_np);
> > > > + d = class_find_device_by_fwnode(&mdio_bus_class,
> > > > + of_fwnode_handle(mdio_bus_np));
> > >
> > > When you look at this, why is it better?
> >
> > I think we should move as much as possible towards firmware-agnostic
> > APIs and use fwnode_handle instead of device_node or software_node or
> > ACPI companion. To discourage this I think we better remove
> > firmware-specific APIs where we have firmware-agnostic ones and
> > eventually clean up drivers that use OF- or ACPI-specific APIs.
>
> Basically, no. This is wrong.
>
> It may sound like a good goal, but there's an underlying issue. This
> goal assumes that the firmware description in OF and ACPI are
> indentical.
If they are different then drivers will make allowance for this, like
I2C core or SPI core does. But most of the modern drivers use
firmware-agnostic APIs (device_property_*()).
ACPI has allowance for device tree properties (via PRP0001 HID
entries), and drivers should work with them.
>
> Sure, looking up devices by fwnode handle makes sense, but looking up
> anything that is described in firmware is not suitable for this kind
> of conversion, because in doing so, you effectively "port" the DT
> bindings to ACPI, and it may not be suitable for ACPI.
>
> So, please don't make wholesale changes that transfer the DT bindings
> into ACPI.
>
I am not "transferring" anything, but I want to make sure the code works
even if we augment OF with software nodes or if DT properties are used
in ACPI.
Thanks.
--
Dmitry
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-03-23 18:33 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 1:54 [PATCH 00/10] Remove class_find_device_by_of_node in favor of finding by firmware node Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 1:54 ` [PATCH net-next 01/10] net: wan: framer: switch to using class_find_device_by_fwnode() Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 1:54 ` [PATCH 02/10] phy: core: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-05-10 11:26 ` Vinod Koul
2026-05-10 11:26 ` Vinod Koul
2026-03-23 1:54 ` [PATCH 03/10] spi: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 13:58 ` Mark Brown
2026-03-23 13:58 ` Mark Brown
2026-03-23 17:16 ` Mark Brown
2026-03-23 17:16 ` Mark Brown
2026-03-23 18:25 ` Dmitry Torokhov
2026-03-23 18:25 ` Dmitry Torokhov
2026-03-23 1:54 ` [PATCH 04/10] regulator: of: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 14:00 ` Mark Brown
2026-03-23 14:00 ` Mark Brown
2026-03-23 18:28 ` Dmitry Torokhov
2026-03-23 18:28 ` Dmitry Torokhov
2026-03-23 19:05 ` Mark Brown
2026-03-23 19:05 ` Mark Brown
2026-03-23 19:41 ` Dmitry Torokhov
2026-03-23 19:41 ` Dmitry Torokhov
2026-03-23 19:58 ` Mark Brown
2026-03-23 19:58 ` Mark Brown
2026-03-23 21:39 ` Dmitry Torokhov
2026-03-23 21:39 ` Dmitry Torokhov
2026-03-23 20:01 ` Andrew Lunn
2026-03-23 20:01 ` Andrew Lunn
2026-03-23 21:36 ` Mark Brown
2026-03-23 21:36 ` Mark Brown
2026-03-23 21:41 ` Dmitry Torokhov
2026-03-23 21:41 ` Dmitry Torokhov
2026-03-23 22:11 ` Andrew Lunn
2026-03-23 22:11 ` Andrew Lunn
2026-03-23 22:27 ` Dmitry Torokhov
2026-03-23 22:27 ` Dmitry Torokhov
2026-03-23 22:39 ` Andrew Lunn
2026-03-23 22:39 ` Andrew Lunn
2026-03-23 22:48 ` Dmitry Torokhov
2026-03-23 22:48 ` Dmitry Torokhov
2026-03-24 13:50 ` Andrew Lunn
2026-03-24 13:50 ` Andrew Lunn
2026-03-24 0:17 ` Russell King (Oracle)
2026-03-24 0:17 ` Russell King (Oracle)
2026-03-23 1:54 ` [PATCH 05/10] leds: led-class: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-31 10:29 ` (subset) " Lee Jones
2026-03-31 10:29 ` Lee Jones
2026-03-23 1:54 ` [PATCH 06/10] mux: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 1:54 ` [PATCH net-next 07/10] net: phy: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 2:54 ` Andrew Lunn
2026-03-23 2:54 ` Andrew Lunn
2026-03-23 5:17 ` Dmitry Torokhov
2026-03-23 5:17 ` Dmitry Torokhov
2026-03-23 8:59 ` Russell King (Oracle)
2026-03-23 8:59 ` Russell King (Oracle)
2026-03-23 18:33 ` Dmitry Torokhov [this message]
2026-03-23 18:33 ` Dmitry Torokhov
2026-03-23 18:39 ` Russell King (Oracle)
2026-03-23 18:39 ` Russell King (Oracle)
2026-03-23 19:35 ` Dmitry Torokhov
2026-03-23 19:35 ` Dmitry Torokhov
2026-03-23 20:15 ` Andrew Lunn
2026-03-23 20:15 ` Andrew Lunn
2026-03-23 21:49 ` Dmitry Torokhov
2026-03-23 21:49 ` Dmitry Torokhov
2026-03-23 22:00 ` Andrew Lunn
2026-03-23 22:00 ` Andrew Lunn
2026-03-23 22:20 ` Dmitry Torokhov
2026-03-23 22:20 ` Dmitry Torokhov
2026-03-23 1:54 ` [PATCH 08/10] fpga: bridge: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 1:54 ` [PATCH 09/10] fpga: manager: " Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 1:54 ` [PATCH 10/10] driver core: class: remove class_find_device_by_of_node() Dmitry Torokhov
2026-03-23 1:54 ` Dmitry Torokhov
2026-03-23 7:43 ` Greg Kroah-Hartman
2026-03-23 7:43 ` Greg Kroah-Hartman
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=acGGWTmSMuc5h3Od@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=broonie@kernel.org \
--cc=dakr@kernel.org \
--cc=davem@davemloft.net \
--cc=driver-core@lists.linux.dev \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mdf@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavel@kernel.org \
--cc=peda@axentia.se \
--cc=rafael@kernel.org \
--cc=trix@redhat.com \
--cc=vkoul@kernel.org \
--cc=yilun.xu@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 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.