From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Alexis Lothore <alexis.lothore@bootlin.com>
Subject: Re: [PATCH net-next] net: phylink: allow PHYs to be attached in 802.3z inband mode
Date: Fri, 27 Mar 2026 16:44:23 +0100 [thread overview]
Message-ID: <a5d7aedb-9770-492f-b528-0a28a652279b@bootlin.com> (raw)
In-Reply-To: <E1w66jW-0000000E3qS-23fW@rmk-PC.armlinux.org.uk>
Hi Russell,
On 27/03/2026 13:56, Russell King (Oracle) wrote:
> Now that we have proper decision making for inband mode support which
> makes it a "best efforts" feature based on the capabilities of the PHY
> and PCS, we can relax whether we expect and permit a PHY to be
> attached. This is especially true for the 2500BASE-X case which some
> PHYs use without inband on their host side interface for 2.5G speeds,
> but use inband for slower speeds switching to SGMII on their host side
> interface.
>
> We already have such a case for some qcom-ethqos setups, although
> qcom-ethqos overrides phylink's inband settings by accessing the PCS
> directly at the moment. This should allow qcom-ethqos to transition to
> defaulting to inband when 2500BASE-X or SGMII is specified in its DTS.
>
> Allow PHYs to be attached when inband mode has been specified, which
> will be necessary to allow inband mode to be used on qcom-ethqos.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> drivers/net/phy/phylink.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 087ac63f9193..1c178038e6f1 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -1965,9 +1965,7 @@ EXPORT_SYMBOL_GPL(phylink_destroy);
> */
> bool phylink_expects_phy(struct phylink *pl)
> {
> - if (pl->cfg_link_an_mode == MLO_AN_FIXED ||
> - (pl->cfg_link_an_mode == MLO_AN_INBAND &&
> - phy_interface_mode_is_8023z(pl->link_interface)))
> + if (pl->cfg_link_an_mode == MLO_AN_FIXED)
> return false;
> return true;
> }
> @@ -2206,9 +2204,7 @@ static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy,
> {
> u32 flags = 0;
>
> - if (WARN_ON(pl->cfg_link_an_mode == MLO_AN_FIXED ||
> - (pl->cfg_link_an_mode == MLO_AN_INBAND &&
> - phy_interface_mode_is_8023z(interface) && !pl->sfp_bus)))
> + if (WARN_ON(pl->cfg_link_an_mode == MLO_AN_FIXED))
> return -EINVAL;
>
> if (pl->phydev)
So I've tested that on my socfpga setup, and I now get this when trying to
bring an interface attached to an SFP up :
socfpga-dwmac ff702000.ethernet eth1: no phy found
This wasn't showing before because our DT has :
&gmac1 {
status = "okay";
phy-mode = "1000base-x";
managed = "in-band-status";
sfp = <&sfp>;
};
It used to kinda work because the problem was hidden with the use of "1000base-x"
as the PHY mode.
Now with this patch, using "sgmii" or "1000base-x" as the phy-mode doesn't
do any difference, as expected.
The real issue IMO is rather how stmmac_init_phy() behaves, it's guarded by:
if (!phylink_expects_phy(priv->phylink))
return 0;
and then tries to find a PHY, failing if there's none. We should probably add
an extra check there to say "if we have a PCS, then it's OK not to have a PHY" ?
Thanks,
Maxime
next prev parent reply other threads:[~2026-03-27 15:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 12:56 [PATCH net-next] net: phylink: allow PHYs to be attached in 802.3z inband mode Russell King (Oracle)
2026-03-27 15:44 ` Maxime Chevallier [this message]
2026-03-27 16:17 ` Russell King (Oracle)
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=a5d7aedb-9770-492f-b528-0a28a652279b@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/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