mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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, alvin.sipraga@analog.com,
	gusfmora@gmail.com, kuncy7@gmail.com, fabianotassotti@gmail.com,
	gabonpivovich@gmail.com, contact@c127.dev
Subject: Re: [PATCH net-next v9 07/11] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
Date: Mon, 09 Nov 2026 08:52:44 +0000	[thread overview]
Message-ID: <179421436480.994134.17527876379511324629@kernel.org> (raw)
In-Reply-To: <7845f6c0-4b8e-48e6-a5e6-b0b3dd8a182b@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] Family D SGMII at 10/100 Mbit/s: phylink is told port 6
  supports those speeds, but the driver never gives the SDS13 SerDes a…

--

net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support

This commit extends the RTL8367S SGMII/HSGMII PCS code to family D
switches. Their CPU SerDes is reached through the indexed SDS13 window,
and their SDS_MISC layout differs from family C. The patch adds family D
tuning tables and SDS_MISC mux/mode values, always sets sds_supported on
family D, and skips the family C SerDes link-force programming in
pcs_link_up() and mac_link_up().

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index a87253b9c2700..86194d555fd6a 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -1660,6 +1783,12 @@ static void rtl8365mb_pcs_link_up(struct phylink_pcs *pcs,
>  	u32 r_speed;
>  	int ret;
>  
> +	/* Family D forces the external MAC ability from mac_link_up(); its
> +	 * SDS_MISC fields do not share the family C link-force layout.
> +	 */
> +	if (rtl8365mb_is_d(priv))
> +		return;
> +

[Severity: Medium]
On family D, does port 6 work with SGMII at 10 or 100 Mbit/s?

rtl8365mb_sds_probe_option() now always sets mb->sds_supported on family
D. So rtl8365mb_phylink_get_caps() advertises SGMII on port 6 along with
10/100:

    config->mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
                               MAC_10 | MAC_100 | MAC_1000FD;
    ...
    if (extint->supported_interfaces & RTL8365MB_PHY_INTERFACE_MODE_SGMII &&
        mb->sds_supported)
            __set_bit(PHY_INTERFACE_MODE_SGMII,
                      config->supported_interfaces);

The RTL8367S-VB entry added later in the series gives port 6
PHY_INTF(SGMII) | PHY_INTF(HSGMII).

On family C, rtl8365mb_pcs_link_up() is the only place that programs the
SerDes SGMII_SPD field for 10/100/1000. With this early return, no family
D path appears to give the SDS13 SerDes a rate:

  - rtl8365mb_pcs_config() writes only PA33PC_EN | PA12PC_EN |
    MAC6_SEL_SDS0 | sds_mode into SDS_MISC. It also clears NWAY_EN, and
    pcs_inband_caps() returns LINK_INBAND_DISABLE, so the SerDes cannot
    learn the speed from in-band AN either.
  - rtl8365mb_phylink_mac_link_up() skips the SDS_MISC write on family D.
  - rtl8365mb_ext_config_forcemode() writes only the MAC-side
    RTL8365MB_D_DIGITAL_INTERFACE_FORCE_REG(port) fields.

Suppose an SGMII PHY or an SGMII fixed-link on port 6 resolves to 100 or
10 Mbit/s. The MAC is forced to that speed, but the PCS has no programmed
rate. If family D hardware does not derive the SerDes rate from the MAC
force register, could the link report up and still pass no valid
traffic?

The family D SGMII branch of rtl8365mb_pcs_get_state() also does not read
the speed back from the SerDes. It keeps what phylink passed in and falls
back to 1000/full:

    if (state->speed == SPEED_UNKNOWN)
            state->speed = SPEED_1000;
    if (state->duplex == DUPLEX_UNKNOWN)
            state->duplex = DUPLEX_FULL;

No later patch in the series seems to add family D SerDes speed
programming or to limit family D SGMII to MAC_1000FD. Should family D
SGMII advertise only MAC_1000FD, or should the SerDes rate be programmed
for 10/100?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/9b73858d-fc09-4988-8bab-fd7b88db9412%40yahoo.com

  reply	other threads:[~2026-11-09  8:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9b73858d-fc09-4988-8bab-fd7b88db9412.ref@yahoo.com>
2026-11-08  8:04 ` [PATCH net-next v9 00/11] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-08  8:05   ` [PATCH net-next v9 01/11] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-08  8:06   ` [PATCH net-next v9 02/11] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-08 14:20     ` Linus Walleij
2026-11-09  8:52     ` netdev-bot+sashiko
2026-11-08  8:07   ` [PATCH net-next v9 03/11] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-08  8:08   ` [PATCH net-next v9 04/11] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-09  8:52     ` netdev-bot+sashiko
2026-11-08  8:09   ` [PATCH net-next v9 05/11] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-11-08  8:10   ` [PATCH net-next v9 06/11] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-11-08  8:11   ` [PATCH net-next v9 07/11] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-09  8:52     ` netdev-bot+sashiko [this message]
2026-11-08  8:11   ` [PATCH net-next v9 08/11] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-11-08 19:13     ` Johan Alvarado
2026-11-08 20:53       ` Mieczyslaw Nalewaj
2026-11-08  8:12   ` [PATCH net-next v9 09/11] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-11-08  8:13   ` [PATCH net-next v9 10/11] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-09  8:52     ` netdev-bot+sashiko
2026-11-08  8:14   ` [PATCH net-next v9 11/11] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-08 14:21     ` Linus Walleij

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=179421436480.994134.17527876379511324629@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alvin.sipraga@analog.com \
    --cc=andrew@lunn.ch \
    --cc=contact@c127.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fabianotassotti@gmail.com \
    --cc=gabonpivovich@gmail.com \
    --cc=gusfmora@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuncy7@gmail.com \
    --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®