Article View: linux.kernel.netdev
Article #17961Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node
From: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 15:55
Date: Tue, 17 Nov 2026 15:55
177 lines
14114 bytes
14114 bytes
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
[ ... ]
> +static int enetc4_add_ppm_fixed_link(struct enetc_pf *pf,
> + struct device_node *np)
> +{
> + struct device_node *fixed_link;
> + struct of_changeset *ocs;
> + int speed, err;
> +
> + enetc4_get_pcr_speed(&pf->si->hw, &speed);
> + speed = enetc_phylink_match_pseudo_mac_speed(speed);
> +
[ ... ]
> + fixed_link = of_changeset_create_node(ocs, np, "fixed-link");
> + if (!fixed_link) {
> + err = -ENOMEM;
> + goto err_destroy;
> + }
> +
> + err = of_changeset_add_prop_u32(ocs, fixed_link, "speed", speed);
[Severity: Low]
This isn't a bug, but can this write a speed value that the fixed-link
binding doesn't allow?
enetc_phylink_pseudo_mac_caps[] in enetc_pf_common.c includes SPEED_25000
and SPEED_20000. When PCR[PSPEED] maps to 20000 Mbps or more,
enetc_phylink_match_pseudo_mac_speed() returns 20000 or 25000.
In Documentation/devicetree/bindings/net/ethernet-controller.yaml, the
fixed-link speed property only allows:
enum: [10, 100, 1000, 2500, 5000, 10000]
phylink still accepts these values. But the node is built at runtime, so
dt-schema never checks it.
Should the binding be extended (as was done for 5000)? Or should the
driver stick to the speeds the binding lists?
> + if (err)
> + goto err_put_node;
[ ... ]
> static int enetc4_link_init(struct enetc_ndev_priv *priv,
> struct device_node *node)
> {
> + bool dynamic = node && of_node_check_flag(node, OF_DYNAMIC);
> struct enetc_pf *pf = enetc_si_priv(priv->si);
> struct device *dev = priv->dev;
> int err;
>
> - err = of_get_phy_mode(node, &pf->if_mode);
> - if (err) {
> - dev_err(dev, "Failed to get PHY mode\n");
> - return err;
> + /* Pseudo-MAC ENETCs are described by a runtime-synthesized fixed-link
> + * node rather than static DT. This covers both a missing OF node and a
> + * PCI-synthesized (OF_DYNAMIC) node, which is an empty node created
> + * by the PCI core and thus carries no fixed-link description.
> + */
[Severity: Low]
Is this comment accurate?
The PCI-synthesized node isn't empty. of_pci_make_dev_node() fills it in
through of_pci_add_properties() (compatible, reg, ...) before it applies
the changeset. The only accurate part is that it has no fixed-link child.
The branch also doesn't really cover a missing OF node. That case just
returns -ENODEV below.
Related to this: at this commit, the PCI core doesn't create a node for an
ENETC endpoint function. pci_bus_add_device() only does it for bridges:
if (pci_is_bridge(dev))
of_pci_make_dev_node(dev);
drivers/pci/quirks.c has no ENETC entries either. So a pseudo-MAC port
without a node always hits the "Missing of_node for Pseudo-MAC port" error
here.
A later patch in the series, "PCI: Create OF node for NXP ENETC pseudo-MAC
functions", fixes that. It adds DECLARE_PCI_FIXUP_FINAL() entries for
PCI_VENDOR_ID_PHILIPS device IDs 0xe101 and 0xe110 that call
of_pci_make_dev_node(). With the whole series applied, only the comment
wording is left.
> + if (enetc_is_pseudo_mac(priv->si) && (!node || dynamic)) {
> + pf->if_mode = PHY_INTERFACE_MODE_INTERNAL;
[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?
> +
> + if (!node) {
> + dev_err(dev, "Missing of_node for Pseudo-MAC port\n");
> + return -ENODEV;
> + }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794581338.git.claudiu.manoil%40nxp.com
Technical Details
Message-ID:
<179493090971.3136.9721533094333369940@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365409-linux-kernel-netdev=dewy.ruReferences:
<4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365409-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node Date: Tue, 17 Nov 2026 15:55:09 +0000 Organization: Usenet Network Message-ID: <179493090971.3136.9721533094333369940@kernel.org> References: <4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2369366"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:FT0BRWkauMlGxR4pSsZa8bb0Szo= sha256:RheeBRiwXqYbQixzKX9IjqWHKThK+VdbLQNzg+rEneg= sha1:X10jFI0eBrAlBYITEs05/0LYbPg= sha256:uLpyxM4+CvWuk19GxKouxb8r5DB8IvVlfAU4kvwUodQ= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 8AB3B114FD3; Tue, 17 Nov 2026 18:55:55 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cFYO-qQ_Ym9T; Tue, 17 Nov 2026 18:55:51 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365409-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 8A5EB114FCF; Tue, 17 Nov 2026 18:55:43 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 4B2D5440E7; Tue, 17 Nov 2026 15:55:18 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794930916; b=HA5qPAKXa81A9TnfCA3vyBN2QwtTCmK00t2jwhSkTeXxBndqwsoQKuMKSXtra83zD/sm bPe/tMRd3ivD5Snk0c2FBNMzRufs1CsMqpHygTTcHoe/Vp0dtdS3uD1Nvx1HCEPf4XEjA J7ZZ2hratOGoc+YQsemV25RClYJXXBuEAFak/VNhdNVdQ6M48o7i//vwptyCKIqgF2vYh zsSIMoqGO6g8TADXGhKY8wB6WCl31lpipC0JBk7Uj/j2bXfWzIK+CBUfXa7eNCtEeN0jx RC6+b+MlLmTcEeikhZFwCePfiES5yPjulc6FaOMnUDW8HsJrPwF10NZQff9IDHMKH6w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794930916; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=NSDZg4lKM868mCut1hwt7C3QqlV1RrLkhZMnguyo28U=; b=g8Qt4kpeU9WKO6eNGbeXU3iLBoJxSzJaNdDgUZbMLKldoYMHWhkt4tL0pKT7yn+rTPgp oRyuZkCNTbNy7wvce8y6fRTxtPc6ox7XSzdcpXRcd25eskMNQozPey9jipsNuxm/t4qxx +oAYD8v0uPAjCQxP4XOOeH171UWTpnxA+4M59SICoxx9otblaQMM2pO17cgXKs7u9Kox0 NsRW6SMYbkcRKHB+AQUfc+grIEv+6aVL1n67cLFZL3qO8cl4TZd4+auavPvzjJ1vvcbwC Ealyt87lQ+VtSIl7enOqcJ103Ma89pWkHmtBiPQXZVLEw8/mdzjL0zq4IgcnR8I26xg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D9KBOrt9; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96F47606A339; Tue, 17 Nov 2026 15:55:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D9KBOrt9 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794930910; b=imszlhoDj/KothxeCgadM1zgSjj9grO+2qDcMd2Dg0u756aHWtKmTaJKDSnkUMYBQK2g JaWd3mPQoUdAXHnrxAaFWazNkUDVpyswxSUtvOgyE4B1vIOpC6IqXhNTmi3i/3SIRxb1w 1KtME+xspXOdy8fvXxGuoDAhlmpSbkEoGi+L+wn6Jq9cwNJm2djgiTN0R6BvWusoz5cQF /dzhdzTcLmmpB0XtwzujbsSlM2XoQi+RaEzHDAp9GIdEaHRzMAS9bqbkl3g/2lq/D5Rj1 DVzGwEAjbdaoSU1QEzZYXUQBJELeKZD+J58CIriiB2TnEXBO355nZlh2QdeBkFbltKg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794930910; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=NSDZg4lKM868mCut1hwt7C3QqlV1RrLkhZMnguyo28U=; b=0PS3n44rohu7SceaRiFDZXsYNxbIuYUU5GYh2FbVntgF3XoqAd8Vtyzn6WLVlwK+iwpH DK9DKizFOungeD+JQSxpqDN1rGdeuWgDNr3dvLgk+LFy7verJQ+M8qyL2SEvVwTJPLBQQ LuFVcZZJ/3mSuPhSd3HUd+xE5QWhulc6qbGRnFKnFhkJrJKjzGS3kqDOuk+MG00YlWwwX b3zUlFuJ4akciGzn8J4JuCMLXKnVFxA+TpbK+6yz8jgdSvYOUHiSPCxDWdkupVm6gnfBm 7uXQd9KZGaVKRqdQgDnqHqJSTb0bYuV4rLevPVab/pFxWBEOrewRxELrb57LaOuFe+g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D9KBOrt9; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5ECC606A32A; Tue, 17 Nov 2026 15:55:10 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 357A31F000C4; Tue, 17 Nov 2026 15:55:10 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794930910; bh=NSDZg4lKM868mCut1hwt7C3QqlV1RrLkhZMnguyo28U=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=D9KBOrt9FdSPa1Ftoriduv0s4TgMLwyPNGunXkoILi6TBoRlQqcW0Ta4lMr7ZCCUg qqvsWgr24YKRJnrQ1k+M5IT6kaAz2oeACYSbQnZKLDUcrSxA0ERfynQ/i6XX7JIO4C Ox1SBS4HCYglJte94wlb8Ntt/4g+WHu2afr513Fd8Ui7m3X2T4hL2n6wO4iQoyt5Xf ErU1oI+pzQ8QTkqOGUemF+aWLpAbItAfzBmv+5580O26Wfbv/9A/ipvdkWFRRfId1N eNr6VbptqtVQ+BSGYDIlB0XpElQUBmmRkKAl4eh2dkJPbkD8Dm1QQGuKQ5jcqCcpr7 9cp5wVQMbXS1A== X-Cc: netdev@vger.kernel.org, s32@nxp.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org X-In-Reply-To: <4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Received-Bytes: 13828