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, alsi@bang-olufsen.dk, 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
Subject: Re: [PATCH net-next v2 2/8] net: dsa: realtek: rtl8365mb: set speed for family D
Date: Sat, 10 Oct 2026 05:14:15 +0000	[thread overview]
Message-ID: <179160925505.434549.8008768293460524931@kernel.org> (raw)
In-Reply-To: <05f792d4-ed17-47b5-abb5-70813ce628cc@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] At this commit, the family D 2.5G MAC force encoding
  (RTL8365MB_D_PORT_SPEED_2500M, split across FORCE_SPEED bits[1:0] and…

--

net: dsa: realtek: rtl8365mb: set speed for family D

This patch makes rtl8365mb_ext_config_forcemode() use the family D
2500M speed code (5). The code is split across FORCE_SPEED bits[1:0] and
a new FORCE_SPEED2 field. On family D the value goes to a per-port force
register at 0x12c0 + port, with an enable register at 0x12c8 + port.
Family C keeps programming 1000M for 2.5G.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 80fc551992195..b1ea8b06a1a18 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -1661,23 +1676,31 @@ static int rtl8365mb_ext_config_forcemode(struct realtek_priv *priv, int port,

[ ... ]

> +	is_d = rtl8365mb_get_family(priv) == RTL8365MB_FAMILY_D;
>  	if (link) {
>  		/* Force the link up with the desired configuration */
>  		r_link = 1;
>  		r_rx_pause = rx_pause ? 1 : 0;
>  		r_tx_pause = tx_pause ? 1 : 0;
>  
> -		/* The speed field has no value for 2.5 Gbps: the rate is
> -		 * determined by the HSGMII SerDes configuration, and the
> -		 * vendor driver programs the 1 Gbps value here.
> -		 */
> -		if (speed == SPEED_2500 || speed == SPEED_1000) {
> +		if (speed == SPEED_2500) {
> +			if (is_d) {
> +				r_speed = RTL8365MB_D_PORT_SPEED_2500M;

[Severity: Medium]
At this point in the series, does the family D 2500M MAC force match
what the PCS side programs for the same link?

At this commit the PCS path still only handles family C.
rtl8365mb_pcs_config() uses the hardcoded ext id, the family C jam
tables and the MAC8 mux:

	const int id = RTL8365MB_SDS_EXT_INTERFACE_ID;
	...
	if (interface == PHY_INTERFACE_MODE_2500BASEX) {
		sds_jam = rtl8365mb_sds_jam_hsgmii;
		sds_jam_size = ARRAY_SIZE(rtl8365mb_sds_jam_hsgmii);
		mode = RTL8365MB_EXT_PORT_MODE_HSGMII;

rtl8365mb_pcs_link_up() also still writes the family C value (1000M for
2.5G) into SDS_MISC:

	if (speed == SPEED_2500 || speed == SPEED_1000) {
		r_speed = RTL8365MB_PORT_SPEED_1000M;

The RTL8367S-VB chip_info entry puts the SerDes on port 6 with ext id 0:

	{ 6, 0, PHY_INTF(SGMII) | PHY_INTF(HSGMII) },

RTL8365MB_SDS_EXT_INTERFACE_ID is 1.

If sds_supported is set on an RTL8367S-VB, rtl8365mb_phylink_get_caps()
advertises 2500BASEX. mac_select_pcs() then returns &mb->pcs, so the
family C pcs_config() and pcs_link_up() run. Meanwhile
rtl8365mb_ext_config_forcemode() writes RTL8365MB_D_PORT_SPEED_2500M.

Would a 2500BASE-X link on family D come up at this commit?

A later patch in the series, "net: dsa: realtek: rtl8365mb: add family
D SDS13 PCS support", appears to fix this. It adds an is_d path to
rtl8365mb_pcs_config(), and rtl8365mb_pcs_link_up() returns early on
family D. The family C PCS handling on family D was added by "net: dsa:
realtek: rtl8365mb: detect RTL8367S-VB", not by this patch.

Could the series be reordered, or 2500BASEX held back for family D until
the PCS support lands, so this in-between state can't be reached?

> +			} else {
> +				/* The speed field has no value for 2.5 Gbps: the rate is
> +				 * determined by the HSGMII SerDes configuration, and the
> +				 * vendor driver programs the 1 Gbps value here.
> +				 */
> +				r_speed = RTL8365MB_PORT_SPEED_1000M;
> +			}
> +		} else if (speed == SPEED_1000) {

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/28382f3f-03c1-4606-9b11-86f118abeafe%40yahoo.com

  reply	other threads:[~2026-10-10  5:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <28382f3f-03c1-4606-9b11-86f118abeafe.ref@yahoo.com>
2026-10-09  4:51 ` [PATCH net-next v2 0/8] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-09  4:53   ` [PATCH net-next v2 1/8] net: dsa: realtek: rtl8365mb: detect RTL8367S-VB Mieczyslaw Nalewaj
2026-10-10  5:14     ` netdev-bot+sashiko
2026-10-09  4:54   ` [PATCH net-next v2 2/8] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-10-10  5:14     ` netdev-bot+sashiko [this message]
2026-10-09  4:55   ` [PATCH net-next v2 3/8] net: dsa: realtek: rtl8365mb: get pvid " Mieczyslaw Nalewaj
2026-10-10  5:14     ` netdev-bot+sashiko
2026-10-09  4:56   ` [PATCH net-next v2 4/8] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-10-09  4:58   ` [PATCH net-next v2 5/8] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-10-09  4:59   ` [PATCH net-next v2 6/8] net: dsa: realtek: rtl8365mb: set/clear pvid " Mieczyslaw Nalewaj
2026-10-10  5:14     ` netdev-bot+sashiko
2026-10-09  5:00   ` [PATCH net-next v2 7/8] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-10-10  5:14     ` netdev-bot+sashiko
2026-10-09  5:02   ` [PATCH net-next v2 8/8] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-10-10  5:14     ` 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=179160925505.434549.8008768293460524931@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --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®