mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH net-next v2 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions
@ 2026-10-16  8:15 netdev-bot+sashiko
  2026-11-03 14:02 ` Claudiu Manoil
  0 siblings, 1 reply; 3+ messages in thread
From: netdev-bot+sashiko @ 2026-10-16  8:15 UTC (permalink / raw)
  To: claudiu.manoil; +Cc: netdev, s32, linux-kernel, bhelgaas, linux-pci, kuba

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] On the in-tree arm64 defconfig, the ENETCv4 pseudo-MAC (PPM)
  ports this series adds still fail to probe.
- [Low] `enetc4_add_ppm_fixed_link()` and its teardown helper in
  drivers/net/ethernet/freescale/enetc/enetc4_pf.c call these changeset…

--

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

This patch registers of_pci_make_dev_node() as a final fixup for the two
ENETC4 PCI device IDs (0xe101 and 0xe110). The PCI core can then
synthesize an OF node for ENETCv4 pseudo-MAC ports that have no static
DT node. The ENETC4 driver needs that node so it can attach a fixed-link
child to it.

> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index de9bbccda21fd..86f0a182224b2 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -6391,6 +6391,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020, of_pci_make_dev_node);
>  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_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 in-tree arm64 defconfig, will the pseudo-MAC ports on
S32N79-RDB still fail to probe?

When CONFIG_PCI_DYNAMIC_OF_NODES is not set, these fixups end up calling
the empty stub in drivers/pci/pci.h:

    static inline void of_pci_make_dev_node(struct pci_dev *pdev) { }

PCI_DYNAMIC_OF_NODES is a plain bool with no default, and nothing in the
tree selects it:

    config PCI_DYNAMIC_OF_NODES
    	bool "Create Device tree nodes for PCI devices"
    	depends on OF_IRQ
    	select OF_DYNAMIC

NXP_ENETC4 neither selects nor implies it. arch/arm64/configs/defconfig
does not set it, but it does set CONFIG_ARCH_S32=y and
CONFIG_NXP_ENETC4=m.

The series enables &netc_iep18 in s32n79-rdb.dts. The
netc_iep18: pcie@241200000 node in s32n79.dtsi has no child function
nodes, so on that config each PPM PF enumerates with no OF node.
enetc4_link_init() then calls enetc4_add_ppm_fixed_link(), which returns
early:

    if (!np)
    	return dev_err_probe(priv->dev, -ENODEV,
    			     "Missing of_node for Pseudo-MAC port\n");

The commit message notes that the quirk "only takes effect when
CONFIG_PCI_DYNAMIC_OF_NODES is enabled". The driver patch in this series
also deliberately avoids a hard Kconfig dependency.

Should the series also enable CONFIG_PCI_DYNAMIC_OF_NODES for this
board? That could be a defconfig update, or a select/imply that does not
break ports described by static DT.

[Severity: Low]
This one is in a related patch from the same series ("net: enetc: Add
pseudo-MAC support for ENETCv4 Ports via a fixed-link node"), which the
OF node created here is meant to serve. Can enetc4_pf.c fail to build
when CONFIG_OF_DYNAMIC is disabled?

enetc4_add_ppm_fixed_link() and its teardown helper call the changeset
API unconditionally:

    of_changeset_init(ocs);

    fixed_link = of_changeset_create_node(ocs, np, "fixed-link");

The same applies to of_changeset_add_prop_u32(),
of_changeset_add_prop_bool(), of_changeset_apply(),
of_changeset_revert() and of_changeset_destroy().

In include/linux/of.h, all of these are declared only under
#ifdef CONFIG_OF_DYNAMIC. The #else branch only stubs the of_reconfig_*
helpers.

OF_DYNAMIC has no default and is only enabled through select (for
example by OF_OVERLAY or PCI_DYNAMIC_OF_NODES). NXP_ENETC4 only depends
on PTP_1588_CLOCK_OPTIONAL and PCI_MSI, and NET_VENDOR_FREESCALE allows
COMPILE_TEST.

In that case, NXP_ENETC4=y/m with OF_DYNAMIC=n looks like a valid
config. Examples are arm64 ARCH_S32 with OF_OVERLAY=n, or a COMPILE_TEST
build with OF=n. Both would hit implicit declaration errors.

arm64 defconfig hides this because it sets CONFIG_OF_OVERLAY=y. No later
patch in the series seems to add a select OF_DYNAMIC or an IS_ENABLED()
guard.

Would a select OF_DYNAMIC on NXP_ENETC4, or an equivalent guard, be
needed here?

>  
>  /*
>   * Devices known to require a longer delay before first config space access

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1791908694.git.claudiu.manoil%40nxp.com

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH net-next v2 0/5] net: enetc: S32N79 pseudo-MAC (PPM) networking support
@ 2026-10-13 17:12 Claudiu Manoil
  2026-10-13 17:12 ` [PATCH net-next v2 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
  0 siblings, 1 reply; 3+ messages in thread
From: Claudiu Manoil @ 2026-10-13 17:12 UTC (permalink / raw)
  To: netdev; +Cc: s32, linux-kernel, Rob Herring, Saravana Kannan, devicetree

This series adds networking support for the ENETCv4.4 pseudo-MAC (PPM)
ports found on the NXP S32N79 SoC. On S32N79, the ENETCv4 ports are
not wired to any external PHY/MII; instead they are internal "pseudo-MAC"
links into the on-chip NETC switch. These links are proprietary, expose
no standard IEEE interface, and run at a speed fixed at boot time by the
Port PCR[PSPEED] register.

A key use case is a port that has no "ethernet" DT node at all: NETC is
reached over PCI from a host that probes the ENETC, while the internal
NETC switch it connects to is not owned by Linux. Such a port must have
its fixed link synthesized at probe time.

The driver synthesizes the fixed link directly in C using an of_changeset:
of_changeset_create_node() adds a "fixed-link" subnode onto the PCI
function's dynamic OF node (CONFIG_PCI_DYNAMIC_OF_NODES), with the "speed"
property read from PCR[PSPEED] at probe time and "full-duplex" set.
phylink then picks up the fixed-link node through dev_fwnode().

The series touches three subsystems:
  - net/enetc:  pseudo-MAC fixed-link support + probing of 4.4 devices
  - arm64 dts:  NETC IEP18 ECAM node on S32N79 and its RDB board enable
  - PCI:        a quirk creating the OF node for the ENETC PMAC functions

Because this is primarily a networking feature and the pieces are
interdependent at runtime, it would be most convenient to merge the
whole series through the netdev tree.

Patch 1 has a runtime (not Kconfig) dependency on
CONFIG_PCI_DYNAMIC_OF_NODES; absent that, the pseudo-MAC probe path
fails gracefully with -ENODEV.

v2:
 - Switched patch 1 from a DT overlay blob (of_overlay_fdt_apply() + a
   .dtso compiled to .dtbo) to of_changeset_create_node(), per review
   feedback. This drops the embedded overlay externs, the Makefile
   .dtbo wrapping, and the OF_OVERLAY Kconfig dependency. The operating
   speed is now baked directly into the changeset-created fixed-link
   node (read once from PCR[PSPEED] at probe time); the phylink
   get_fixed_state callback is no longer needed and was removed.
 - Patch 2: described why there are two ENETC PF IDs in the commit
   message, as per review.
 - Patch 3: replaced the 'msi-parent' stub property with 'msi-map', as
   per H/W spec.
 - Patch 5: reworded the commit message to match patch 1's fixed-link
   approach (no functional change); added Bjorn's Acked-by.
v1: initial submission.

Claudiu Manoil (5):
  net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link
    node
  net: enetc: Enable probing of version 4.4 devices
  arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports
  arm64: dts: s32n79-rdb: enable NETC IEP18
  PCI: Create OF node for NXP ENETC pseudo-MAC functions

 arch/arm64/boot/dts/freescale/s32n79-rdb.dts  |   4 +
 arch/arm64/boot/dts/freescale/s32n79.dtsi     |  24 ++++
 drivers/net/ethernet/freescale/enetc/enetc.c  |  12 ++
 drivers/net/ethernet/freescale/enetc/enetc.h  |   1 +
 .../net/ethernet/freescale/enetc/enetc4_pf.c  | 113 +++++++++++++++++-
 .../net/ethernet/freescale/enetc/enetc_hw.h   |   1 +
 .../freescale/enetc/enetc_pf_common.c         |  41 ++++++-
 .../freescale/enetc/enetc_pf_common.h         |   1 +
 drivers/pci/quirks.c                          |   2 +
 9 files changed, 190 insertions(+), 9 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-03 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16  8:15 [PATCH net-next v2 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions netdev-bot+sashiko
2026-11-03 14:02 ` Claudiu Manoil
  -- strict thread matches above, loose matches on Subject: below --
2026-10-13 17:12 [PATCH net-next v2 0/5] net: enetc: S32N79 pseudo-MAC (PPM) networking support Claudiu Manoil
2026-10-13 17:12 ` [PATCH net-next v2 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil

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®