From: sashiko-bot@kernel.org
To: "Claudiu Manoil" <claudiu.manoil@nxp.com>
Cc: imx@lists.linux.dev, devicetree@vger.kernel.org, robh@kernel.org,
conor+dt@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node
Date: Sat, 14 Nov 2026 15:17:04 +0000 [thread overview]
Message-ID: <sashiko-outbox-214685@kernel.org> (raw)
In-Reply-To: <4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] net: enetc: enetc_phylink_match_pseudo_mac_speed() returns
>10G fixed-link
--
commit 15e36db0338302292004a6cbf3727d8f9d63565f
Author: Claudiu Manoil <claudiu.manoil@nxp.com>
net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node
This commit adds pseudo-MAC support for ENETCv4 ports lacking static DT
nodes by synthesizing a fixed-link DT subnode at probe time with the speed
derived from PCR[PSPEED].
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
> index 8facc8bf8693a..b032b586f07b4 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
> @@ -436,6 +436,43 @@ void enetc_mdiobus_destroy(struct enetc_pf *pf)
> }
> EXPORT_SYMBOL_GPL(enetc_mdiobus_destroy);
>
> +static struct {
> + unsigned long mac_cap;
> + int speed; /* descending order sorted */
> +} enetc_phylink_pseudo_mac_caps[] = {
> + { MAC_25000FD, SPEED_25000 },
> + { MAC_20000FD, SPEED_20000 },
> + { MAC_10000FD, SPEED_10000 },
> + { MAC_5000FD, SPEED_5000 },
> + { MAC_2500FD, SPEED_2500 },
> + { MAC_1000FD, SPEED_1000 },
> + { MAC_100FD, SPEED_100 },
> + { MAC_10FD, SPEED_10 },
> +};
> +
> +static unsigned long enetc_phylink_get_pseudo_mac_caps(void)
> +{
> + unsigned long mac_caps = 0;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(enetc_phylink_pseudo_mac_caps); i++)
> + mac_caps |= enetc_phylink_pseudo_mac_caps[i].mac_cap;
> +
> + return mac_caps;
> +}
> +
> +int enetc_phylink_match_pseudo_mac_speed(int speed)
> +{
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(enetc_phylink_pseudo_mac_caps); i++)
> + if (enetc_phylink_pseudo_mac_caps[i].speed <= speed)
> + return enetc_phylink_pseudo_mac_caps[i].speed;
> +
> + return SPEED_UNKNOWN;
> +}
> +EXPORT_SYMBOL_GPL(enetc_phylink_match_pseudo_mac_speed);
[Severity: Medium]
Can phylink_parse_fixedlink() handle SPEED_20000 or SPEED_25000 when
enetc4_add_ppm_fixed_link() writes the result of
enetc_phylink_match_pseudo_mac_speed() into the fixed-link DT node?
When PCR[PSPEED] is configured for 20 Gbps or 25 Gbps at boot,
enetc_phylink_match_pseudo_mac_speed() returns 20000 or 25000, but
phylink_fill_fixedlink_supported() only populates linkmodes up to
10000baseT_Full:
drivers/net/phy/phylink.c:phylink_fill_fixedlink_supported() {
...
linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, supported);
}
As a result, phy_caps_lookup() in phylink_parse_fixedlink() returns NULL,
triggering a phylink warning ("fixed link full duplex 20000Mbps not
recognised") and leaving pl->supported, pl->link_config.advertising, and
pl->link_config.lp_advertising with no speed linkmode bits set.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794581338.git.claudiu.manoil@nxp.com?part=1
next prev parent reply other threads:[~2026-11-14 15:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 15:02 [PATCH net-next v4 0/6] net: enetc: S32N79 pseudo-MAC (PPM) networking support Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node Claudiu Manoil
2026-11-14 15:17 ` sashiko-bot [this message]
2026-11-13 15:02 ` [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 4/6] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 5/6] arm64: dts: s32n79-rdb: enable NETC IEP18 Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
2026-11-14 15:17 ` sashiko-bot
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=sashiko-outbox-214685@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=claudiu.manoil@nxp.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.