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 v18 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
Date: Wed, 02 Dec 2026 23:58:54 +0000 [thread overview]
Message-ID: <179625593492.3146.17769311237884164405@kernel.org> (raw)
In-Reply-To: <61c88068-ea97-4fd2-99d1-cb5abccd0694@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] On family D, rtl8365mb_pcs_config()
(drivers/net/dsa/realtek/rtl8365mb_main.c) skips the…
--
net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
This commit adds family D support to the existing RTL8367S SGMII/HSGMII
PCS code. The family D CPU SerDes is reached through the indexed SDS13
window, and SDS_MISC uses a different layout. The family D paths get
separate tuning tables and their own SDS_MISC setup, and the family D
SerDes port no longer writes DIGITAL_INTERFACE_SELECT or advertises
10/100 Mbit/s.
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 7500ea9b3a627..da0c5f254560f 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
[ ... ]
> @@ -1575,34 +1663,63 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
[ ... ]
> ret = regmap_update_bits(priv->map, RTL8365MB_SDS_MISC_REG,
> - RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK |
> - RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK,
> - mode == RTL8365MB_EXT_PORT_MODE_SGMII ?
> - RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK :
> - RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK);
> + misc_mask, misc_val);
> if (ret)
> return ret;
>
> - val = mode << RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_OFFSET(id);
> - ret = regmap_update_bits(priv->map,
> - RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(id),
> - RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(id),
> - val);
> - if (ret)
> - return ret;
> + /* On family D, SDS_MISC configures the SerDes mode directly; id (1)
> + * refers to RGMII port 7 on RTL8367S-VB and must not be overwritten.
> + */
> + if (!is_d) {
> + val = sds_mode << RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_OFFSET(id);
> + ret = regmap_update_bits(priv->map,
> + RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(id),
> + RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(id),
> + val);
> + if (ret)
> + return ret;
> + }
[Severity: Medium]
On family D, rtl8365mb_pcs_config() now skips the whole
DIGITAL_INTERFACE_SELECT update. Should it write the EXT0 field instead?
The RTL8367S-VB chip entry describes the SerDes as extint id 0:
{ 6, 0, PHY_INTF(SGMII) | PHY_INTF(HSGMII) },
That is the EXT0 field, bits 3:0 of RTL8365MB_DIGITAL_INTERFACE_SELECT_REG0
(0x1305). Nothing on the family D path writes that field in SGMII or
2500base-x mode.
The reason given for skipping is that id 1 is the RGMII port 7. That
argues for writing id 0 rather than skipping the write altogether.
Family C sets up this register in two places: the init jam writes
{ 0x1305, 0xC000 }, and pcs_config() writes the SerDes mode into EXT1.
Family D has no init jam table. The register is still used on family D,
because rtl8365mb_ext_config_rgmii() writes the EXT1 field for RGMII on
port 7.
Suppose the EXT0 power-on or strap default on some board is not a SerDes
mode. Could MAC6 then fail to connect to the SerDes and the CPU link stay
down, even though SDS_MISC has MAC6_SEL_SDS0 and the mode field set?
The commit message says:
The EXT0 field of that
register keeps its reset or bootloader value.
Can a bootloader value survive here? rtl8365mb_setup() calls
rtl8365mb_reset_chip() before any PCS configuration:
priv->write_reg_noack(priv, RTL8365MB_CHIP_RESET_REG,
FIELD_PREP(RTL8365MB_CHIP_RESET_HW_MASK, 1));
...
return regmap_read_poll_timeout(priv->map, RTL8365MB_CHIP_RESET_REG, val,
!(val & RTL8365MB_CHIP_RESET_HW_MASK),
20000, 1e6);
That is a full hardware reset, so it looks like EXT0 will always hold its
power-on or strap default when rtl8365mb_pcs_config() runs.
The commit message also says it was not verified whether the vendor
RTL8367D sequence programs this field. The new source comment, however,
says that SDS_MISC configures the SerDes mode directly, as if that were
established. It also does not mention that EXT0 is left unprogrammed.
Could the comment say both of those things, so it matches the commit
message?
This code is unchanged at the end of the series. The RTL8367S-VB chip
entry makes this path reachable, and no later patch in the series
programs EXT0.
>
> /* Take the SerDes out of reset. The vendor driver does this only
> * after the SerDes mux and the interface mode are configured.
> */
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1%40yahoo.com
next prev parent reply other threads:[~2026-12-02 23:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1.ref@yahoo.com>
2026-12-01 23:48 ` [PATCH net-next v18 00/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-12-01 23:50 ` [PATCH net-next v18 01/15] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 02/15] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 03/15] net: dsa: realtek: rtl8365mb: refactor forcemode handling Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 04/15] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 05/15] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko
2026-12-01 23:51 ` [PATCH net-next v18 06/15] net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling Mieczyslaw Nalewaj
2026-12-01 23:51 ` [PATCH net-next v18 07/15] net: dsa: realtek: rtl8365mb: add VLAN 4k/IVL for family D Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko
2026-12-01 23:51 ` [PATCH net-next v18 08/15] net: dsa: realtek: rtl8365mb: refactor PVID handling Mieczyslaw Nalewaj
2026-12-01 23:55 ` [PATCH net-next v18 09/15] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Mieczyslaw Nalewaj
2026-12-01 23:55 ` [PATCH net-next v18 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko [this message]
2026-12-01 23:56 ` [PATCH net-next v18 11/15] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-12-01 23:56 ` [PATCH net-next v18 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-12-02 23:58 ` netdev-bot+sashiko
2026-12-01 23:56 ` [PATCH net-next v18 13/15] net: dsa: realtek: rtl8365mb: refactor QoS priority handling Mieczyslaw Nalewaj
2026-12-01 23:56 ` [PATCH net-next v18 14/15] net: dsa: realtek: rtl8365mb: use PCP numbering on family D Mieczyslaw Nalewaj
2026-12-01 23:56 ` [PATCH net-next v18 15/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-12-02 23:58 ` 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=179625593492.3146.17769311237884164405@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.