Netdev List
 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 v11 10/13] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
Date: Thu, 19 Nov 2026 22:36:33 +0000	[thread overview]
Message-ID: <179512779318.3136.8422558829727451994@kernel.org> (raw)
In-Reply-To: <cdf74b4b-77e7-4b06-9947-8b70afd63117@yahoo.com>

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

  reply	other threads:[~2026-11-19 22:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cf3fd237-2290-4002-8de0-ea4100ef0f85.ref@yahoo.com>
2026-11-17  7:34 ` [PATCH net-next v11 00/13] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-17  7:35   ` [PATCH net-next v11 01/13] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-17  7:36   ` [PATCH net-next v11 02/13] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-17  7:36   ` [PATCH net-next v11 03/13] net: dsa: realtek: rtl8365mb: refactor forcemode handling Mieczyslaw Nalewaj
2026-11-17  7:37   ` [PATCH net-next v11 04/13] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-17  7:38   ` [PATCH net-next v11 05/13] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-17  7:38   ` [PATCH net-next v11 06/13] net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling Mieczyslaw Nalewaj
2026-11-17  7:39   ` [PATCH net-next v11 07/13] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D Mieczyslaw Nalewaj
2026-11-17  8:23     ` Linus Walleij
2026-11-18  1:48       ` Gustavo Foletto Mora
2026-11-18  7:59         ` Mieczyslaw Nalewaj
2026-11-19  1:47           ` Gustavo Foletto Mora
2026-11-19 22:36     ` netdev-bot+sashiko
2026-11-17  7:39   ` [PATCH net-next v11 08/13] net: dsa: realtek: rtl8365mb: refactor PVID handling Mieczyslaw Nalewaj
2026-11-17  8:34     ` Linus Walleij
2026-11-17  8:53       ` Mieczyslaw Nalewaj
2026-11-18  1:55     ` Gustavo Foletto Mora
2026-11-17  7:40   ` [PATCH net-next v11 09/13] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Mieczyslaw Nalewaj
2026-11-18  2:00     ` Gustavo Foletto Mora
2026-11-19 22:36     ` netdev-bot+sashiko
2026-11-17  7:41   ` [PATCH net-next v11 10/13] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-19 22:36     ` netdev-bot+sashiko [this message]
2026-11-17  7:41   ` [PATCH net-next v11 11/13] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-11-17  7:42   ` [PATCH net-next v11 12/13] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-19 22:36     ` netdev-bot+sashiko
2026-11-17  7:43   ` [PATCH net-next v11 13/13] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-19 22:36     ` 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=179512779318.3136.8422558829727451994@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