Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH RESEND v4 net-next 07/14] net: enetc: differentiate phylink capabilities for pseudo-MAC and standalone MAC
Date: Tue, 21 Jul 2026 02:13:31 +0000	[thread overview]
Message-ID: <20260721021331.6E5DD1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260720014317.1059359-8-wei.fang@oss.nxp.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [High] The patch advertises `PHY_INTERFACE_MODE_10GBASER` as a supported interface to phylink despite the feature being incomplete and explicitly unsupported.

Pre-existing issues:
- [High] The hardware configuration function `enetc4_mac_config()` does not handle `PHY_INTERFACE_MODE_1000BASEX`, leading to runtime errors and an unconfigured MAC.
- [High] ENETC v4 fails to probe for any PCS-dependent PHY interface modes because `enetc4_pf_ops` lacks a `create_pcs` callback.
--

--- Patch [7]: [PATCH RESEND v4 net-next 07/14] net: enetc: differentiate phylink capabilities for pseudo-MAC and standalone MAC ---
commit 87cae554b380c00e9f19136c8479811aa8887e05
Author: Claudiu Manoil <claudiu.manoil@nxp.com>

net: enetc: differentiate phylink capabilities for pseudo-MAC and standalone MAC

This patch restricts ENETC pseudo-MACs to PHY_INTERFACE_MODE_INTERNAL while
configuring standard full-duplex speeds. For standalone ENETC (v4), it updates
the interface modes to include 10GBASER (as preparation) and explicit duplex
capabilities.

> diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> index f24269a48c26b..75ee117e9b1df 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> @@ -602,7 +602,6 @@ static void enetc4_mac_config(struct enetc_pf *pf, unsigned int mode,
>  		val |= IFMODE_SGMII;
>  		break;
>  	case PHY_INTERFACE_MODE_10GBASER:

[Severity: High]
This isn't a bug introduced by this patch, but does enetc4_mac_config() in 
drivers/net/ethernet/freescale/enetc/enetc4_pf.c fail to handle 
PHY_INTERFACE_MODE_1000BASEX?

If phylink configures the MAC for 1000BASEX, which is advertised as supported, 
it looks like it will fall through to the default case here and leave the MAC 
unconfigured:

    default:
        dev_err(priv->dev, "Unsupported PHY mode:%d\n", phy_mode);
        return;

> -	case PHY_INTERFACE_MODE_XGMII:
>  	case PHY_INTERFACE_MODE_USXGMII:
>  		val |= IFMODE_XGMII;
>  		break;
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
> index 3597cb81a7ccb..781b22198ca86 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
[ ... ]
> @@ -359,7 +359,8 @@ static bool enetc_port_has_pcs(struct enetc_pf *pf)
>  	return (pf->if_mode == PHY_INTERFACE_MODE_SGMII ||
>  		pf->if_mode == PHY_INTERFACE_MODE_1000BASEX ||
>  		pf->if_mode == PHY_INTERFACE_MODE_2500BASEX ||
> -		pf->if_mode == PHY_INTERFACE_MODE_USXGMII);
> +		pf->if_mode == PHY_INTERFACE_MODE_USXGMII ||
> +		pf->if_mode == PHY_INTERFACE_MODE_10GBASER);
>  }

[Severity: High]
This is a pre-existing issue, but does ENETC v4 fail to probe for any
PCS-dependent interface modes?

Since enetc_port_has_pcs() returns true for SGMII, 1000BASEX, 2500BASEX, 
USXGMII, and now 10GBASER, enetc_imdio_create() will be called during probe. 

However, enetc4_pf_ops in drivers/net/ethernet/freescale/enetc/enetc4_pf.c 
lacks a .create_pcs callback. Won't this trigger the check in 
enetc_imdio_create():

    if (!pf->ops->create_pcs) {
        dev_err(dev, "Creating PCS is not supported\n");
        return -EOPNOTSUPP;
    }

and cause the entire probe sequence to fail for these modes?

[ ... ]
> @@ -400,25 +401,42 @@ int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node *node,
>  {
[ ... ]
> +		if (!is_enetc_rev1(priv->si)) {
> +			mac_caps |= MAC_5000FD | MAC_10000FD;
> +			__set_bit(PHY_INTERFACE_MODE_10GBASER,
> +				  pf->phylink_config.supported_interfaces);
> +		}

[Severity: High]
The commit message explicitly states that 10GBASE-R mode is not supported yet
and is added simply as preparation. 

Will advertising an unsupported interface mode to phylink in 
enetc_phylink_create() cause it to accept configurations for it, leading to a 
broken configuration state or a hard probe failure when it attempts to 
configure the MAC and PCS?

> +
> +		phy_interface_set_rgmii(pf->phylink_config.supported_interfaces);
> +	} else {
> +		mac_caps |= MAC_10FD | MAC_100FD | MAC_1000FD | MAC_2500FD |
> +			    MAC_5000FD | MAC_10000FD | MAC_20000FD |
> +			    MAC_25000FD;
> +	}
> +
> +	pf->phylink_config.mac_capabilities = mac_caps;
>  	phylink = phylink_create(&pf->phylink_config, of_fwnode_handle(node),
>  				 pf->if_mode, ops);
>  	if (IS_ERR(phylink)) {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720014317.1059359-1-wei.fang@oss.nxp.com?part=7

  reply	other threads:[~2026-07-21  2:13 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  1:43 [PATCH RESEND v4 net-next 00/14] net: enetc: cleanups and improvements wei.fang
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 01/14] net: enetc: extract common helpers for MAC promiscuous mode setting wei.fang
2026-07-20 14:02   ` Joe Damato
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 02/14] net: enetc: extract common helpers for MAC hash filter configuration wei.fang
2026-07-21  2:13   ` sashiko-bot
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 03/14] net: enetc: convert ndo_set_rx_mode() to ndo_set_rx_mode_async() wei.fang
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 04/14] net: enetc: improve MAFT entry management with bitmap tracking wei.fang
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 05/14] net: enetc: use PCI device name for debugfs directory wei.fang
2026-07-20 13:46   ` Joe Damato
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 06/14] net: enetc: simplify enetc4_set_port_speed() wei.fang
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 07/14] net: enetc: differentiate phylink capabilities for pseudo-MAC and standalone MAC wei.fang
2026-07-21  2:13   ` sashiko-bot [this message]
2026-07-21  5:46     ` Wei Fang (OSS)
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 08/14] net: enetc: remove invalid code from enetc4_pl_mac_link_up() wei.fang
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 09/14] net: enetc: open-code enetc4_set_default_si_vlan_promisc() wei.fang
2026-07-20 15:26   ` Joe Damato
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 10/14] net: enetc: refactor SI VLAN promiscuous mode configuration wei.fang
2026-07-22 13:25   ` Joe Damato
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 11/14] net: enetc: move enetc_set_si_vlan_promisc() to enetc_pf_common.c wei.fang
2026-07-20 15:28   ` Joe Damato
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 12/14] net: enetc: remove redundant num_vsi field from enetc_port_caps wei.fang
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 13/14] net: enetc: use alloc_etherdev_mqs() to create netdev for VF driver wei.fang
2026-07-20 17:36   ` Joe Damato
2026-07-21  2:01     ` Wei Fang (OSS)
2026-07-21  2:13   ` sashiko-bot
2026-07-21  5:54     ` Wei Fang (OSS)
2026-07-20  1:43 ` [PATCH RESEND v4 net-next 14/14] net: enetc: use kzalloc_flex() for enetc_psfp_gate allocation wei.fang
2026-07-20 13:48   ` Joe Damato
2026-07-21  2:13   ` 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=20260721021331.6E5DD1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wei.fang@oss.nxp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox