mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Zxyan Zhu <zxyan0222@gmail.com>, netdev@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Russell King <linux@armlinux.org.uk>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Serge Semin <fancer.lancer@gmail.com>,
	Romain Gantois <romain.gantois@bootlin.com>,
	Hariprasad Kelam <hkelam@marvell.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: stmmac: Skip PHY attach if custom PCS is in use
Date: Wed, 29 Jul 2026 08:22:08 +0200	[thread overview]
Message-ID: <fb9a8280-4166-43ed-a9e5-b54d7079b222@bootlin.com> (raw)
In-Reply-To: <20260726132618.3580612-3-zxyan0222@gmail.com>

Hi,

I think sashiko's are correct that we can err on the safe side and move
the check inside the "if (addr < 0)" check (even though I don't think we
have platforms with a PCS but no fwnode-described PHYs, but just to be
safe).

Also, sashiko reports an issue on patch 1 that this exact patch is solving, so
you may want to re-send but with patches in the reverse order.

Maxime

On 7/26/26 15:26, Zxyan Zhu wrote:
> When a platform provides a custom PCS via the pcs_init callback,
> the MAC's phylink_pcs is already configured. In this case, phylink
> validates against the PCS's supported interfaces and manages link
> state through the PCS, so no traditional PHY device is needed.
> 
> Without this, stmmac_init_phy() falls through to the no-phy-node
> path and errors out with "no phy found" when the DT has no
> phy-handle for such interfaces.
> 
> Skip the PHY attach when priv->hw->phylink_pcs is already set and no
> phy-handle is specified in the device tree.
> 
> Fixes: f0ef433fc264 ("net: stmmac: introduce pcs_init/pcs_exit stmmac operations")
> Signed-off-by: Zxyan Zhu <zxyan0222@gmail.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 562d20830b94..044ed3b89247 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1346,6 +1346,10 @@ static int stmmac_init_phy(struct net_device *dev)
>  		int addr = priv->plat->phy_addr;
>  		struct phy_device *phydev;
>  
> +		/* If a custom PCS is in use, no PHY is needed */
> +		if (priv->hw->phylink_pcs)
> +			return 0;
> +
>  		if (addr < 0) {
>  			netdev_err(priv->dev, "no phy found\n");
>  			return -ENODEV;


  reply	other threads:[~2026-07-29  6:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-26 13:26 [PATCH net-next v2 0/2] net: stmmac: Fix PHY attach when " Zxyan Zhu
2026-07-26 13:26 ` [PATCH net-next v2 1/2] net: phylink: allow PHYs to be attached in 802.3z inband mode Zxyan Zhu
2026-07-26 13:26 ` [PATCH net-next v2 2/2] net: stmmac: Skip PHY attach if custom PCS is in use Zxyan Zhu
2026-07-29  6:22   ` Maxime Chevallier [this message]
2026-07-27  6:49 ` [PATCH net-next v2 0/2] net: stmmac: Fix PHY attach when " Maxime Chevallier
2026-07-29  2:12   ` Jakub Kicinski

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=fb9a8280-4166-43ed-a9e5-b54d7079b222@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=hkelam@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=romain.gantois@bootlin.com \
    --cc=zxyan0222@gmail.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

all inboxes | Powered by JetHome®