From: Florian Fainelli <florian.fainelli@broadcom.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, jonas.gorski@gmail.com, andrew@lunn.ch,
olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk,
rmk+kernel@armlinux.org.uk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 3/6 RESEND] net: dsa: b53: constrain SerDes interfaces to initialized PCSes
Date: Tue, 27 Oct 2026 11:05:11 -0700 [thread overview]
Message-ID: <7e2f2f3e-adfb-47e7-a60f-ec475ab4bef5@broadcom.com> (raw)
In-Reply-To: <179305843878.3134.5626134378768180663@kernel.org>
On 10/26/26 16:47, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
>
> 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] Ports muxed to SGMII now fail phylink creation when SerDes
> discovery fails or CONFIG_B53_SERDES=n.
>
> --
>
> net: dsa: b53: constrain SerDes interfaces to initialized PCSes
>
> This patch stores a supported interface bitmap on each b53 PCS that is
> discovered, and uses that bitmap for capability reporting and PCS
> selection. On SRAB ports whose mux selects a SerDes, it clears the
> parallel interfaces inherited from the common code. It also stops
> advertising 2500BASE-X.
>
>> diff --git a/drivers/net/dsa/b53/b53_srab.c b/drivers/net/dsa/b53/b53_srab.c
>> index 9818b3922a377..3fabae80dc1a8 100644
>> --- a/drivers/net/dsa/b53/b53_srab.c
>> +++ b/drivers/net/dsa/b53/b53_srab.c
>> @@ -451,9 +451,11 @@ static void b53_srab_phylink_get_caps(struct b53_device *dev, int port,
>>
>> switch (p->mode) {
>> case PHY_INTERFACE_MODE_SGMII:
>> + /* The mux connects this port to a SerDes, not a parallel bus. */
>> + phy_interface_zero(config->supported_interfaces);
>> #if IS_ENABLED(CONFIG_B53_SERDES)
>> /* If p->mode indicates SGMII mode, that essentially means we
>> - * are using a serdes. As the serdes for the capabilities.
>> + * are using a SerDes. Ask it for the supported interfaces.
>> */
>> b53_serdes_phylink_get_caps(dev, port, config);
>> #endif
>
> [Severity: Medium]
> Could an SGMII-muxed port end up here with an empty supported_interfaces
> mask, so that phylink_create() fails for it?
>
> b53_srab_mux_init() sets p->mode before it tries discovery. If discovery
> fails, the loop continues with p->mode still set to SGMII and
> pcs[lane].dev still NULL:
>
> case MUX_CONFIG_SGMII:
> p->mode = PHY_INTERFACE_MODE_SGMII;
> ret = b53_serdes_init(dev, port);
> if (ret) {
> dev_err(...);
> continue;
> }
>
> In that state b53_serdes_phylink_get_caps() returns early on
> !dev->pcs[lane].dev, so nothing goes back into the mask.
>
> With CONFIG_B53_SERDES=n, the b53_serdes_init() stub in b53_serdes.h
> always returns -ENODEV and the refill call is compiled out. Every
> SGMII-muxed port then ends up in this state.
>
> phylink_create() then rejects the port:
>
> if (phy_interface_empty(config->supported_interfaces)) {
> dev_err(config->dev,
> "phylink: error: empty supported_interfaces\n");
> return ERR_PTR(-EINVAL);
> }
>
> DSA then sets the user port up as unused. Before this patch, these ports
> kept GMII/MII/REVMII from b53_phylink_get_caps() and registered normally.
>
> Ports that never select the PCS are hit as well. In
> bcm958625-meraki-alamo.dtsi, SRAB port@4 and port@5 (sw0/sw1) use a
> 1000 Mb/s fixed-link with no phy-mode, so DSA passes
> PHY_INTERFACE_MODE_NA. b53_serdes_phylink_mac_select_pcs() returns NULL
> for that mode both before and after this patch.
>
> These two ports are the conduits for the cascaded QCA8337 switches
> (ethernet = <&sgmii0> / <&sgmii1>). Wouldn't those switches lose their
> upstream link too?
>
> The commit message says:
>
> A failed discovery must not leave a usable serial interface
> advertised without its PCS.
>
> It does not mention that the port then fails to register at all, or that
> fixed-link/NA ports are affected. Is that the intended result?
>
> Later patches in the series do not change b53_srab_phylink_get_caps() or
> b53_srab_mux_init(), so this still applies at the end of the series.
>
Agreed, this was an unintended regression. The next revision preserves
the legacy interface capabilities when SerDes discovery fails or
CONFIG_B53_SERDES is disabled, allowing fixed links without phy-mode to
continue registering. Only successful PCS discovery replaces those
capabilities with the supported serial interfaces. The commit message
has also been updated.
pw-bot: cr
--
Florian
next prev parent reply other threads:[~2026-10-27 18:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 22:56 [PATCH net 0/6 RESEND] net: dsa: b53: PCS fixes Florian Fainelli
2026-10-22 22:56 ` [PATCH net 1/6 RESEND] net: dsa: b53: serialize SerDes register transactions Florian Fainelli
2026-10-22 22:56 ` [PATCH net 2/6 RESEND] net: dsa: b53: manage SerDes power through the PCS callbacks Florian Fainelli
2026-10-26 23:47 ` netdev-bot+sashiko
2026-10-27 17:31 ` Florian Fainelli
2026-10-22 22:56 ` [PATCH net 3/6 RESEND] net: dsa: b53: constrain SerDes interfaces to initialized PCSes Florian Fainelli
2026-10-26 23:47 ` netdev-bot+sashiko
2026-10-27 18:05 ` Florian Fainelli [this message]
2026-10-22 22:56 ` [PATCH net 4/6 RESEND] net: dsa: b53: configure PCS negotiation and forced link parameters Florian Fainelli
2026-10-26 23:47 ` netdev-bot+sashiko
2026-10-27 18:06 ` Florian Fainelli
2026-10-22 22:56 ` [PATCH net 5/6 RESEND] net: dsa: b53: report link state through the PCS Florian Fainelli
2026-10-26 23:47 ` netdev-bot+sashiko
2026-10-27 18:07 ` Florian Fainelli
2026-10-22 22:56 ` [PATCH net 6/6 RESEND] net: dsa: b53: apply resolved link settings to serial port MACs Florian Fainelli
2026-10-26 23:47 ` netdev-bot+sashiko
2026-10-27 18:08 ` Florian Fainelli
2026-10-27 9:31 ` [PATCH net 0/6 RESEND] net: dsa: b53: PCS fixes Chenguang Zhao
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=7e2f2f3e-adfb-47e7-a60f-ec475ab4bef5@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jonas.gorski@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--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 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.