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,
o.rempel@pengutronix.de
Subject: Re: [PATCH net-next v16 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
Date: Mon, 30 Nov 2026 15:12:46 +0000 [thread overview]
Message-ID: <179605156649.3146.10383763580449481811@kernel.org> (raw)
In-Reply-To: <d095cf30-6a85-476c-bc7c-febadbda27a2@yahoo.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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] On family D the SerDes port (port 6, SGMII/2500base-x) still
advertises MAC_SYM_PAUSE | MAC_ASYM_PAUSE to phylink.
- [Low] In drivers/net/dsa/realtek/rtl8365mb_main.c, two new family D
definitions name the same SerDes in contradictory ways.
--
net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
This commit extends the rtl8365mb SGMII/HSGMII PCS code to family D
switches. On these switches the CPU SerDes is reached through the indexed
SDS13 window, and SDS_MISC has a different layout. It adds family D tuning
tables, an index argument for the SDS indirect accessors, and family D
branches in pcs_config(), pcs_get_state(), pcs_link_up(), get_caps() and
mac_link_up().
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 7500ea9b3a627..59901e683dca1 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
[ ... ]
> @@ -334,7 +340,25 @@
> #define RTL8365MB_SDS_OPTION_ARM_KEY 0x0249
> #define RTL8365MB_SDS_OPTION_REG 0x13C1
>
> +/* Family D uses the SDS13 indirect window for its MAC6 SerDes.
> + * RTL8365MB_SDS_MISC_REG is at the same register address as on family C
> + * in the vendor RTL8367D API, with the bit layout below.
> + */
> +#define RTL8365MB_D_SDS_EXT0_INDEX 13
> +#define RTL8365MB_D_FIBER_CFG2_REG 0x13E8
> +#define RTL8365MB_D_FIBER_CFG2_RX_DISABLE_MASK GENMASK(7, 6)
> +#define RTL8365MB_D_FIBER_CFG2_RX_DISABLE_SDS0 BIT(6)
> +#define RTL8365MB_D_SDS_MISC_PA33PC_EN BIT(11)
> +#define RTL8365MB_D_SDS_MISC_PA12PC_EN BIT(10)
> +#define RTL8365MB_D_SDS_MISC_MAC6_SEL_SDS0 BIT(9)
[ ... ]
> @@ -1575,34 +1663,58 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
>
> /* Tune the SerDes with vendor-prescribed parameters */
> for (i = 0; i < sds_jam_size; i++) {
> - ret = rtl8365mb_sds_write(priv, sds_jam[i].reg,
> - sds_jam[i].val);
> + ret = rtl8365mb_sds_write(priv, sds_index,
> + sds_jam[i].reg, sds_jam[i].val);
> + if (ret)
> + return ret;
> + }
> +
> + /* Family-specific post-tuning configuration */
> + if (is_d) {
> + /* The register and field names follow the vendor RTL8367D API,
> + * whose SDS numbering differs from the SDS13 window used
> + * here. As in the vendor sequence the whole 2-bit field
> + * (bits 7:6) is written, so bit 7 is cleared as well.
> + */
> + ret = regmap_update_bits(priv->map, RTL8365MB_D_FIBER_CFG2_REG,
> + RTL8365MB_D_FIBER_CFG2_RX_DISABLE_MASK,
> + RTL8365MB_D_FIBER_CFG2_RX_DISABLE_SDS0);
> if (ret)
> return ret;
> +
> + misc_mask = RTL8365MB_D_SDS_MISC_CFG_MASK;
> + misc_val = RTL8365MB_D_SDS_MISC_PA33PC_EN |
> + RTL8365MB_D_SDS_MISC_PA12PC_EN |
> + RTL8365MB_D_SDS_MISC_MAC6_SEL_SDS0 | sds_mode;
[Severity: Low]
This isn't a bug, but the two new family D names used here seem to
contradict each other:
- RTL8365MB_D_SDS_MISC_MAC6_SEL_SDS0 (BIT(9) of SDS_MISC) reads as
muxing MAC6 to SDS0.
- RTL8365MB_D_FIBER_CFG2_RX_DISABLE_SDS0 (BIT(6) of 0x13E8) reads as
disabling RX on that same SDS0.
Read literally, rtl8365mb_pcs_config() selects SDS0 for MAC6 and disables
its receiver in the same bring-up sequence.
The comment above says the names follow the vendor RTL8367D API, whose SDS
numbering differs from the SDS13 window. Both macros use the vendor
naming, though, so the comment doesn't explain why they conflict.
Could the definitions be renamed? Or could the comment say which SerDes or
path bit 6 actually disables, for example only the fiber RX path?
[ ... ]
> @@ -1982,10 +2131,17 @@ static void rtl8365mb_phylink_get_caps(struct dsa_switch *ds, int port,
> }
>
> if (extint->supported_interfaces & RTL8365MB_PHY_INTERFACE_MODE_SGMII &&
> - mb->sds_supported)
> + mb->sds_supported) {
> __set_bit(PHY_INTERFACE_MODE_SGMII,
> config->supported_interfaces);
>
> + /* The SerDes rate is not programmed for 10 and 100 Mbit/s on
> + * family D, see rtl8365mb_pcs_link_up().
> + */
> + if (rtl8365mb_is_d(priv))
> + config->mac_capabilities &= ~(MAC_10 | MAC_100);
> + }
[Severity: Medium]
On family D, MAC_SYM_PAUSE and MAC_ASYM_PAUSE are still set in
mac_capabilities for the SerDes port. Will pause actually take effect on
that port?
With this patch, rtl8365mb_phylink_mac_link_up() skips the SerDes pause
enables on family D:
if (rtl8365mb_interface_is_serdes(interface) &&
!rtl8365mb_is_d(priv)) {
u32 val = 0;
if (tx_pause)
val |= RTL8365MB_SDS_MISC_SGMII_TXFC_MASK;
That leaves only the TXPAUSE/RXPAUSE bits that
rtl8365mb_d_ext_config_forcemode() writes into the MAC force register.
The family C comment in the same function says flow control testing
showed pause frames are only sent when the SerDes TXFC bit is set. It also
says the MAC force pause bits alone have no effect on the SerDes port.
The commit message drops 10 and 100 Mbit/s for the same reason:
"It is not known whether the SerDes follows that register"
It also says:
"Flow control on the family D SerDes port has not been tested."
If the family D SerDes behaves like family C, phylink would resolve
tx_pause and rx_pause as enabled and advertise pause to the link partner.
ethtool -a would report pause as on, but no pause frames would be sent.
Should MAC_SYM_PAUSE | MAC_ASYM_PAUSE also be cleared on family D until
flow control on this port has been checked?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/aebcc7f6-d5f8-4157-b63a-e2e707d9859b%40yahoo.com
next prev parent reply other threads:[~2026-11-30 15:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <aebcc7f6-d5f8-4157-b63a-e2e707d9859b.ref@yahoo.com>
2026-11-29 15:02 ` [PATCH net-next v16 00/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-29 15:06 ` [PATCH net-next v16 01/15] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-29 15:06 ` [PATCH net-next v16 02/15] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-29 15:06 ` [PATCH net-next v16 03/15] net: dsa: realtek: rtl8365mb: refactor forcemode handling Mieczyslaw Nalewaj
2026-11-29 15:07 ` [PATCH net-next v16 04/15] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-29 15:07 ` [PATCH net-next v16 05/15] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-29 22:47 ` Linus Walleij
2026-11-30 15:12 ` netdev-bot+sashiko
2026-11-29 15:07 ` [PATCH net-next v16 06/15] net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling Mieczyslaw Nalewaj
2026-11-29 15:07 ` [PATCH net-next v16 07/15] net: dsa: realtek: rtl8365mb: set and get VLAN 4k for family D Mieczyslaw Nalewaj
2026-11-29 22:48 ` Linus Walleij
2026-11-30 15:12 ` netdev-bot+sashiko
2026-11-29 15:07 ` [PATCH net-next v16 08/15] net: dsa: realtek: rtl8365mb: refactor PVID handling Mieczyslaw Nalewaj
2026-11-29 15:11 ` [PATCH net-next v16 09/15] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Mieczyslaw Nalewaj
2026-11-29 15:11 ` [PATCH net-next v16 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-30 15:12 ` netdev-bot+sashiko [this message]
2026-11-29 15:11 ` [PATCH net-next v16 11/15] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-11-29 15:11 ` [PATCH net-next v16 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-30 15:12 ` netdev-bot+sashiko
2026-11-29 15:12 ` [PATCH net-next v16 13/15] net: dsa: realtek: rtl8365mb: refactor QoS priority handling Mieczyslaw Nalewaj
2026-11-29 22:51 ` Linus Walleij
2026-11-29 15:12 ` [PATCH net-next v16 14/15] net: dsa: realtek: rtl8365mb: use PCP numbering on family D Mieczyslaw Nalewaj
2026-11-29 22:52 ` Linus Walleij
2026-11-30 15:12 ` netdev-bot+sashiko
2026-11-29 15:12 ` [PATCH net-next v16 15/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
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=179605156649.3146.10383763580449481811@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=o.rempel@pengutronix.de \
--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