Re: [PATCH net-next v11 10/13] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support

From: netdev-bot+sashiko

Date: Thu Nov 19 2026 - 17:36:43 EST


Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The comments this patch leaves in
drivers/net/dsa/realtek/rtl8365mb_main.c do not agree on which…

--

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

This commit extends the RTL8367S SGMII/HSGMII PCS code in rtl8365mb to
family D switches. On those switches the CPU SerDes is reached through the
indexed SDS13 window and the SDS_MISC layout is different. The family D
tuning tables and register sequence come from the vendor RTL8367D port API.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 983257250205f..6f80b171745e1 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
> @@ -264,7 +264,8 @@
> * interface, indexed by the external port number with port 5 (the first
> * external port) as the base. Other RTL8367 families index this register
> * differently (e.g. the RTL8367R uses (id + 1) % 2), so this mapping only
> - * holds for the RTL8367C-style parts this driver supports.
> + * holds for the RTL8367C-style parts and for family D, where it is the same
> + * (one bit per external port, base port 5), as in the vendor RTL8367D API.
> */
> #define RTL8365MB_BYPASS_LINE_RATE_REG 0x03F7
> #define RTL8365MB_BYPASS_LINE_RATE_MASK(_port) BIT((_port) - 5)

[ ... ]

> @@ -315,8 +317,10 @@
> #define RTL8365MB_SDS_REG_LINK_STATUS 0x003d
> #define RTL8365MB_SDS_LINK_STATUS_LINK_MASK BIT(4)
>
> -/* The embedded SerDes can only be muxed to external interface 1 (MAC8),
> - * which is port 6.
> +/* On family C the embedded SerDes can only be muxed to external interface
> + * 1 (MAC8), which is port 6. Family D has it on external interface 0
> + * (MAC6), see RTL8365MB_D_SDS_EXT0_INDEX. RTL8365MB_SDS_EXT_INTERFACE_ID
> + * below is the family C id; the SerDes port is 6 on both families.
> */
> #define RTL8365MB_SDS_EXT_INTERFACE_ID 1
> #define RTL8365MB_SDS_EXT_INTERFACE_PORT 6

[Severity: Low]
Do these two comments agree on which RTL8365MB_BYPASS_LINE_RATE_REG bit
belongs to the family D SerDes?

The register comment above calls it "one bit per external interface",
with "port 5 (the first external port)" as the base, and says family D
is "the same".

This comment puts the family D SerDes on external interface 0 (MAC6) at
port 6. The RTL8367S-VB entry added later in the series puts ext0 on
port 6 and ext1 on port 7, so port 5 is not an external port on family D.

rtl8365mb_pcs_config() still clears the family C mask on both families:

ret = regmap_update_bits(priv->map, RTL8365MB_BYPASS_LINE_RATE_REG,
RTL8365MB_SDS_BYPASS_LINE_RATE_MASK, 0);

RTL8365MB_SDS_BYPASS_LINE_RATE_MASK expands to BIT(6 - 5), which is
BIT(1). On family C both readings give BIT(1), because ext1 is port 6.
On family D they give different bits.

Suppose the RTL8367D register is indexed by external interface id. Would
the family D path then leave the SerDes bypass bit (ext0, BIT(0)) at its
reset value? It would also clear the bit for ext1 (port 7, RGMII) instead.

Suppose instead it is indexed by port - 5, which the new comment says
the vendor RTL8367D API does. Then the code is fine. Could the general
part of the register comment ("one bit per external interface", "port 5
(the first external port)") be updated to match family D?

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cf3fd237-2290-4002-8de0-ea4100ef0f85%40yahoo.com