🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by Claudiu Manoil Fri, 13 Nov 2026 15:02
[PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions
#15815
Author: Claudiu Manoil
Date: Fri, 13 Nov 2026 15:02
42 lines
10664 bytes
NXP ENETCv4 pseudo-MAC (PPM) ports can be probed as pure PCI endpoints,
without any "ethernet" node in the static device tree. The ENETC4 driver
describes their fixed link by attaching a fixed-link node to the PCI
function's own OF node, which requires that node to exist.

Request the PCI core to synthesize a per-function OF node for these
devices by registering of_pci_make_dev_node() as a final fixup, following
the existing precedent for the Xilinx, Red Hat and EFAR devices. The
helper is a no-op when the function already has a static OF node, so this
has no effect on platforms that describe ENETC via static DT. It only
takes effect when CONFIG_PCI_DYNAMIC_OF_NODES is enabled.

Both ENETC4 PCI device IDs are covered (0xe101 and 0xe110), since either
can be instantiated as a pseudo-MAC port on S32N79.

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
v4: none
v3: none
v2: none (reworded the overlay reference to match patch 1's fixed-link
    approach; no functional change)

 drivers/pci/quirks.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f1f47ea2ee4..71f272d8a296 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6563,6 +6563,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA, 0x0220, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe110, of_pci_make_dev_node);
 
 /*
  * Devices known to require a longer delay before first config space access
-- 
2.34.1
Re: [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions
#17958
Author: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 15:55
107 lines
12087 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The two new fixups for 0xe101 and 0xe110 in
  drivers/pci/quirks.c only do something when…
- [Low] The comment above the of_pci_make_dev_node() fixup block in
  drivers/pci/quirks.c (lines 6553-6560) gives one reason for the…

--

PCI: Create OF node for NXP ENETC pseudo-MAC functions

This commit registers of_pci_make_dev_node() as a final fixup for the NXP
ENETC4 PCI device IDs 0xe101 and 0xe110. The new per-function OF node lets
the ENETC4 driver attach a fixed-link child to pseudo-MAC ports that have
no static DT node. The fixup only does anything when
CONFIG_PCI_DYNAMIC_OF_NODES is enabled.

> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 7f1f47ea2ee41..71f272d8a2965 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -6563,6 +6563,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node);
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node);
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA, 0x0220, of_pci_make_dev_node);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101, of_pci_make_dev_node);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe110, of_pci_make_dev_node);

[Severity: Medium]
With the default arm64 config, will these fixups do anything on the
S32N79 platform this series targets?

If CONFIG_PCI_DYNAMIC_OF_NODES is not set, of_pci_make_dev_node() is an
empty stub:

drivers/pci/pci.h:
#else
static inline void of_pci_make_dev_node(struct pci_dev *pdev) { }

PCI_DYNAMIC_OF_NODES is a user-visible bool, and nothing in the tree
selects it. NXP_ENETC4 selects OF_DYNAMIC, so there is no build problem.
However, it does not select or imply PCI_DYNAMIC_OF_NODES.

arch/arm64/configs/defconfig sets CONFIG_ARCH_S32=y and
CONFIG_NXP_ENETC4=m, but it does not set PCI_DYNAMIC_OF_NODES.

The s32n79.dtsi change in this series adds netc_iep18 without child nodes
for the PCI functions. So dev->of_node stays NULL for the pseudo-MAC PF,
and enetc4_link_init() fails the probe:

drivers/net/ethernet/freescale/enetc/enetc4_pf.c:enetc4_link_init() {
    ...
		if (!node) {
			dev_err(dev, "Missing of_node for Pseudo-MAC port\n");
			return -ENODEV;
		}
    ...
}

This error message does not mention the missing config option.

So with the default arm64 config, "arm64: dts: s32n79-rdb: enable NETC
IEP18" does not get the PPM PF/VF instances probed, which is what it sets
out to do.

The commit messages say this dependency is intentional, because the
driver also handles ports described by static DT. That is a reason not to
add a hard "depends on". Would an "imply PCI_DYNAMIC_OF_NODES" on
NXP_ENETC4, or a defconfig update, work instead? The Kconfig help text
notes that turning the option on also creates OF nodes for all PCI
bridges.

[Severity: Low]
This isn't a bug, but the comment above this block of fixups no longer
covers every entry:

/*
 * For a PCI device with multiple downstream devices, its driver may use
 * a flattened device tree to describe the downstream devices.
 * To overlay the flattened device tree, the PCI device and all its ancestor
 * devices need to have device tree nodes on system base device tree. Thus,
 * before driver probing, it might need to add a device tree node as the final
 * fixup.
 */

An ENETC4 pseudo-MAC function has no downstream devices and loads no FDT
overlay. enetc4_add_ppm_fixed_link() only applies an of_changeset that
adds a fixed-link child to the function's own node.

The PCI_DYNAMIC_OF_NODES help text in drivers/pci/Kconfig also describes
only the overlay use case.

Could the comment, and perhaps the help text, be updated to cover this
use?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794581338.git.claudiu.manoil%40nxp.com
RE: [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions
#18646
Author: Claudiu Manoil
Date: Wed, 18 Nov 2026 16:49
111 lines
21592 bytes
From: netdev-bot+sashiko@kernel.org <netdev-bot+sashiko@kernel.org>
Sent: Tuesday, November 17, 2026 5:55 PM
> To: Claudiu Manoil <claudiu.manoil@nxp.com>
> Cc: netdev@vger.kernel.org; dl-S32 <S32@nxp.com>; bhelgaas@google.com;
> linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; kuba@kernel.org
> Subject: Re: [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC
> pseudo-MAC functions
> 
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
> 
> Critical: 0 * High: 0 * Medium: 1 * Low: 1
> 
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
> 
> - [Medium] The two new fixups for 0xe101 and 0xe110 in
>   drivers/pci/quirks.c only do something when...
> - [Low] The comment above the of_pci_make_dev_node() fixup block in
>   drivers/pci/quirks.c (lines 6553-6560) gives one reason for the...
> 
> --
> 
> PCI: Create OF node for NXP ENETC pseudo-MAC functions
> 
> This commit registers of_pci_make_dev_node() as a final fixup for the NXP
> ENETC4 PCI device IDs 0xe101 and 0xe110. The new per-function OF node lets
> the ENETC4 driver attach a fixed-link child to pseudo-MAC ports that have
> no static DT node. The fixup only does anything when
> CONFIG_PCI_DYNAMIC_OF_NODES is enabled.
> 
> > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> > index 7f1f47ea2ee41..71f272d8a2965 100644
> > --- a/drivers/pci/quirks.c
> > +++ b/drivers/pci/quirks.c
> > @@ -6563,6 +6563,8 @@
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021,
> of_pci_make_dev_node);
> >  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005,
> of_pci_make_dev_node);
> >  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660,
> of_pci_make_dev_node);
> >  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA, 0x0220,
> of_pci_make_dev_node);
> > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101,
> of_pci_make_dev_node);
> > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe110,
> of_pci_make_dev_node);
> 
> [Severity: Medium]
> With the default arm64 config, will these fixups do anything on the
> S32N79 platform this series targets?
> 
> If CONFIG_PCI_DYNAMIC_OF_NODES is not set, of_pci_make_dev_node() is
> an
> empty stub:
> 
> drivers/pci/pci.h:
> #else
> static inline void of_pci_make_dev_node(struct pci_dev *pdev) { }
> 
> PCI_DYNAMIC_OF_NODES is a user-visible bool, and nothing in the tree
> selects it. NXP_ENETC4 selects OF_DYNAMIC, so there is no build problem.
> However, it does not select or imply PCI_DYNAMIC_OF_NODES.
> 
> arch/arm64/configs/defconfig sets CONFIG_ARCH_S32=y and
> CONFIG_NXP_ENETC4=m, but it does not set PCI_DYNAMIC_OF_NODES.
> 
> The s32n79.dtsi change in this series adds netc_iep18 without child nodes
> for the PCI functions. So dev->of_node stays NULL for the pseudo-MAC PF,
> and enetc4_link_init() fails the probe:
> 
> drivers/net/ethernet/freescale/enetc/enetc4_pf.c:enetc4_link_init() {
>     ...
> 		if (!node) {
> 			dev_err(dev, "Missing of_node for Pseudo-MAC
> port\n");
> 			return -ENODEV;
> 		}
>     ...
> }
> 
> This error message does not mention the missing config option.
> 
> So with the default arm64 config, "arm64: dts: s32n79-rdb: enable NETC
> IEP18" does not get the PPM PF/VF instances probed, which is what it sets
> out to do.
> 
> The commit messages say this dependency is intentional, because the
> driver also handles ports described by static DT. That is a reason not to
> add a hard "depends on". Would an "imply PCI_DYNAMIC_OF_NODES" on
> NXP_ENETC4, or a defconfig update, work instead? The Kconfig help text
> notes that turning the option on also creates OF nodes for all PCI
> bridges.

Same reply as here, for v2:
https://lore.kernel.org/all/GV2PR04MB117408067A4647C476FAD617596692@GV2PR04MB11740.eurprd04.prod.outlook.com/

CONFIG_PCI_DYNAMIC_OF_NODES is not a hard Kconfig dependency
because only the newly introduced S32N79 chip makes use of this feature
currently. This is intentional. So, this config will be enabled only for S32N79
platforms, for now, separately.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads