RE: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node
From: Claudiu Manoil
Date: Wed Nov 18 2026 - 11:11:22 EST
From: netdev-bot+sashiko@xxxxxxxxxx <netdev-bot+sashiko@xxxxxxxxxx>
Sent: Tuesday, November 17, 2026 5:55 PM
> To: Claudiu Manoil <claudiu.manoil@xxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; dl-S32 <S32@xxxxxxx>; bhelgaas@xxxxxxxxxx;
> linux-pci@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; kuba@xxxxxxxxxx
> Subject: Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for
> ENETCv4 Ports via a fixed-link node
>
> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
>
> Critical: 0 * High: 0 * Medium: 1 * Low: 2
>
> 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] In enetc4_link_init()
> (drivers/net/ethernet/freescale/enetc/enetc4_pf.c:1025-1047), the...
> - [Low] In drivers/net/ethernet/freescale/enetc/enetc4_pf.c,
> enetc4_link_init() (lines 1035-1047) only builds the pseudo-MAC fixed-...
> - [Low] enetc4_add_ppm_fixed_link()
> (drivers/net/ethernet/freescale/enetc/enetc4_pf.c:996) writes a...
>
> --
>
> net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node
>
> This lets ENETCv4 pseudo-MAC ports probe without a static DT "ethernet"
> node. At probe time an of_changeset adds a "fixed-link" child node whose
> speed is read from PCR[PSPEED]. The pseudo-MAC path runs when the port
> has
> no OF node or only an OF_DYNAMIC node, and the changeset is reverted on
> teardown and on the probe error unwind.
>
> > diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> > index 71c971618388b..b7e7201e6a71a 100644
> > --- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> > +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
>
[ ... ]
> [Severity: Medium]
> Is the OF_DYNAMIC flag enough to show that the node has no link
> description?
>
> __of_node_dup() sets OF_DYNAMIC, and DT overlays create their nodes with
> it in add_changeset_node(). An overlay can also be applied on top of the
> node from of_pci_make_dev_node() to add phy-mode or fixed-link.
>
> In either case, this branch:
>
> - skips of_get_phy_mode()
> - forces PHY_INTERFACE_MODE_INTERNAL
> - calls enetc4_add_ppm_fixed_link(), which calls
> of_changeset_create_node(ocs, np, "fixed-link") without checking for an
> existing fixed-link child
>
> __of_attach_node() puts the new node at the head of the child list:
>
> np->sibling = np->parent->child;
> np->parent->child = np;
>
> phylink_parse_fixedlink() looks the node up with
> fwnode_get_named_child_node(), so it would find the driver-synthesized
> fixed-link before the DT one.
>
> Would that leave two fixed-link children and replace the DT-provided speed
> with the PCR[PSPEED] value?
>
> The commit message says:
>
> The pseudo-MAC path is selected when the port has no OF node, or when it
> only has the empty PCI-synthesized node (OF_DYNAMIC), which carries no
> fixed-link description.
>
> Nothing in the code checks that, though. Would a check such as
> of_get_child_by_name(node, "fixed-link") or
> of_property_present(node, "phy-mode") make the code match the
> description?
>
Same point was made on v2, and the reply is the same [1].
This is a theoretical case, the Pseudo-MAC ports will not have overlays
on top. It's either static DT node (fully specified), or a clean PCI-synthetized
node. Any other configuration for the Pseudo-MAC node (like the one implied
above) is not valid.
[1] https://lore.kernel.org/all/GV2PR04MB1174015C406D353895C57476696692@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/