From: netdev-bot+sashiko@kernel.org
To: namiltd@yahoo.com
Cc: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com,
kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, linux@armlinux.org.uk, luizluca@gmail.com,
maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5 7/9] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
Date: Wed, 14 Oct 2026 08:56:44 +0000 [thread overview]
Message-ID: <179196820499.434549.15338494683852265589@kernel.org> (raw)
In-Reply-To: <2699037c-3cb9-40b6-b02b-8d20934729f9@yahoo.com>
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] Consider family D port 6 in SGMII with managed = "in-band-
status" and no PHY.
--
net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
This extends the rtl8365mb SGMII/HSGMII PCS code to family D switches. On
those switches the CPU SerDes is reached through the indexed SDS13 window,
and the SDS_MISC layout differs from family C. For family D,
pcs_link_up() becomes a no-op and the link is forced only from
mac_link_up().
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 9ba31dfb161c8..6c51f4805b595 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
[ ... ]
> @@ -1636,6 +1740,17 @@ static void rtl8365mb_pcs_get_state(struct phylink_pcs *pcs,
> if (!state->link)
> return;
>
> + if (is_d) {
> + /* Only 2500base-x is a fixed rate; for the other modes keep
> + * the speed and duplex phylink passed in.
> + */
> + if (state->interface == PHY_INTERFACE_MODE_2500BASEX) {
> + state->duplex = DUPLEX_FULL;
> + state->speed = SPEED_2500;
> + }
> + return;
> + }
> +
[Severity: Medium]
On family D in SGMII mode with no PHY, can phylink pass SPEED_UNKNOWN to
mac_link_up() here?
Take port 6 with phy-mode = "sgmii", managed = "in-band-status" and no
phy-handle. rtl8365mb_pcs_inband_caps() only reports LINK_INBAND_DISABLE.
That makes phylink_pcs_neg_mode() pick PHYLINK_PCS_NEG_OUTBAND, and since
there is no phydev the mode stays MLO_AN_INBAND.
phylink_resolve() then gets the link state through
phylink_mac_pcs_get_state(), which seeds speed and duplex like this:
drivers/net/phy/phylink.c:phylink_mac_pcs_get_state() {
...
} else {
state->speed = pl->link_config.speed;
state->duplex = pl->link_config.duplex;
...
}
phylink_create() sets link_config.speed/duplex to SPEED_UNKNOWN and
DUPLEX_UNKNOWN, and nothing updates them on this path.
When the SerDes reports link up, the family D branch above only overrides
speed and duplex for 2500BASEX. For SGMII it returns with SPEED_UNKNOWN
still set. The call chain would then be:
phylink_link_up()
rtl8365mb_phylink_mac_link_up()
rtl8365mb_ext_config_forcemode()
dev_err(..., "unsupported port speed %s\n", ...)
return -EINVAL
mac_link_up() returns void, so phylink still marks the link up and turns
the carrier on. However, the family D MAC force register is never
programmed, so wouldn't the port show link up and pass no traffic?
Family C avoids this because its pcs_get_state() reads speed and duplex
back from SDS_MISC. This also seems to still be present at the end of the
series.
Could the family D branch report a concrete speed and duplex for SGMII as
well, or otherwise avoid returning link up with an unknown speed?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/aa5fa12c-e43e-4e5e-9f77-c6eaf477abc4%40yahoo.com
next prev parent reply other threads:[~2026-10-14 8:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <b45a3350-44a3-45ad-89cc-452c25edbd7d.ref@yahoo.com>
2026-10-13 8:23 ` [PATCH net-next v5 0/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-13 8:38 ` [PATCH net-next v5 1/9] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-10-13 8:39 ` [PATCH net-next v5 2/9] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-10-13 23:27 ` Linus Walleij
2026-10-13 8:40 ` [PATCH net-next v5 3/9] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-10-13 8:41 ` [PATCH net-next v5 4/9] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-10-14 8:56 ` netdev-bot+sashiko
2026-10-13 8:42 ` [PATCH net-next v5 5/9] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-10-14 8:56 ` netdev-bot+sashiko
2026-10-13 8:43 ` [PATCH net-next v5 6/9] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-10-13 8:43 ` [PATCH net-next v5 7/9] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-10-14 8:56 ` netdev-bot+sashiko [this message]
2026-10-13 8:44 ` [PATCH net-next v5 8/9] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-10-14 8:56 ` netdev-bot+sashiko
2026-10-13 8:45 ` [PATCH net-next v5 9/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-14 8:56 ` netdev-bot+sashiko
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=179196820499.434549.15338494683852265589@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=luizluca@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=namiltd@yahoo.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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®