Netdev List
 help / color / mirror / Atom feed
From: Mieczyslaw Nalewaj <namiltd@yahoo.com>
To: netdev-bot+sashiko@kernel.org
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 v19 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
Date: Fri, 4 Dec 2026 07:21:16 +0100	[thread overview]
Message-ID: <77de5e70-b66f-4ac7-a28c-2dff6f6ec57b@yahoo.com> (raw)
In-Reply-To: <179635072993.3146.4719994977464012754@kernel.org>

On 12/4/2026 3:18 AM, netdev-bot+sashiko@kernel.org wrote:
> 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() in
>   drivers/net/dsa/realtek/rtl8365mb_main.c never programs the EXT0 mode…
> 
> --
> 
> net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
> 
> This commit extends the rtl8365mb RTL8367S SGMII/HSGMII PCS code to
> family D switches. On family D the SerDes is reached through the indexed
> SDS13 window, and SDS_MISC has a different layout. Family D gets its own
> tuning tables, SDS_MISC programming and link state handling. The family C
> path is unchanged.
> 
>> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
>> index 4fd79dbb2d691..4a8a04fc6d755 100644
>> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
>> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
> 
> [ ... ]
> 
>> @@ -1576,34 +1664,67 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
> 
> [ ... ]
> 
>> +		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;
>> +	} else {
>> +		/* Mux the SerDes to MAC8 in the requested mode */
>> +		misc_mask = RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK |
>> +			    RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK;
>> +		misc_val  = (sds_mode == RTL8365MB_EXT_PORT_MODE_SGMII) ?
>> +			    RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK :
>> +			    RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK;
>> +	}
>> +
>>  	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 selects the SerDes mode. id (1) refers to
>> +	 * RGMII port 7 on RTL8367S-VB and must not be overwritten. The EXT0
>> +	 * field of DIGITAL_INTERFACE_SELECT is not programmed here and keeps
>> +	 * its power-on or strap default; whether the vendor sequence sets it
>> +	 * for the SerDes was not verified, but the link came up on all tested
>> +	 * boards.
>> +	 */
>> +	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, does anything program the EXT0 mode nibble (bits 3:0) of
> DIGITAL_INTERFACE_SELECT_REG0 (0x1305) for the SerDes port 6 / MAC6?
> 
> The whole DIGITAL_INTERFACE_SELECT write in rtl8365mb_pcs_config() is
> skipped when is_d is set. Family D has no init jam table, so it never gets
> the family C { 0x1305, 0xC000 } entry either.
> 
> The only other family D write to this register is in
> rtl8365mb_ext_config_rgmii(). That write only updates the extint id 1
> nibble, which is used by the RGMII port 7:
> 
> 	ret = regmap_update_bits(
> 		priv->map, RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(extint->id),
> 		RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(extint->id),
> 		RTL8365MB_EXT_PORT_MODE_RGMII
> 			<< RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_OFFSET(
> 				   extint->id));
> 
> After rtl8365mb_reset_chip(), the EXT0 interface mode therefore keeps
> whatever value the strap or EEPROM set. SDS_MISC is still written with
> MAC6_SEL_SDS0 plus the SGMII/HSGMII mode, and the PCS is treated as
> configured.
> 
> Suppose a board's straps leave EXT0 disabled or in a parallel-bus mode.
> Could MAC6 and the SDS_MISC mux then disagree, so that the port 6 SerDes
> link is dead or unreliable and the driver does not notice?
> 
> The commit message says that whether the vendor RTL8367D sequence programs
> this field was not verified, and that "the link came up on all tested
> boards". This is still the case after the RTL8367S-VB chip entry is added
> later in the series.
> 
> Would it be possible to program EXT0 explicitly for SGMII/HSGMII on
> family D? Or at least read it back and warn when it does not match the
> requested SerDes mode?
> 
> [ ... ]
> 

Thanks for the review.

I checked this against the vendor RTL8367D port API. In
dal_rtl8367d_port_extMode_set() the SerDes path for MAC6 (id == 1) does not
touch DIGITAL_INTERFACE_SELECT (0x1305) at all. It sets MAC6_SEL_SDS0, loads
the SGCfg/HSGCfg tuning table through the SDS indirect window, sets the
FIBER_CFG_2 RX disable field, and then programs PA12PC_EN, PA33PC_EN and the
mode field in SDS_MISC.

The EXT0 field (SELECT_GMII_0, bits 3:0) is defined in the vendor register
header but is not used anywhere in the vendor code. Every write to 0x1305 there
is to SELECT_GMII_1 (EXT1, RGMII on port 7). So on this family the SerDes mode
is selected by SDS_MISC alone, and the driver matches the vendor sequence by not
writing EXT0.

No code change is needed.

  reply	other threads:[~2026-12-04  6:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <59c7992d-1c83-4bf1-a2f4-c853d4777190.ref@yahoo.com>
2026-12-03  2:09 ` [PATCH net-next v19 00/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-12-03  2:10   ` [PATCH net-next v19 01/15] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-12-03  2:10   ` [PATCH net-next v19 02/15] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-12-03  2:11   ` [PATCH net-next v19 03/15] net: dsa: realtek: rtl8365mb: refactor forcemode handling Mieczyslaw Nalewaj
2026-12-03  2:11   ` [PATCH net-next v19 04/15] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-12-03  2:11   ` [PATCH net-next v19 05/15] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-12-03  2:11   ` [PATCH net-next v19 06/15] net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling Mieczyslaw Nalewaj
2026-12-03  2:11   ` [PATCH net-next v19 07/15] net: dsa: realtek: rtl8365mb: add VLAN 4k/IVL for family D Mieczyslaw Nalewaj
2026-12-03  2:11   ` [PATCH net-next v19 08/15] net: dsa: realtek: rtl8365mb: refactor PVID handling Mieczyslaw Nalewaj
2026-12-03  2:17   ` [PATCH net-next v19 09/15] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Mieczyslaw Nalewaj
2026-12-03  2:17   ` [PATCH net-next v19 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-12-04  2:18     ` netdev-bot+sashiko
2026-12-04  6:21       ` Mieczyslaw Nalewaj [this message]
2026-12-03  2:18   ` [PATCH net-next v19 11/15] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-12-03  2:18   ` [PATCH net-next v19 12/15] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-12-03  2:18   ` [PATCH net-next v19 13/15] net: dsa: realtek: rtl8365mb: refactor QoS priority handling Mieczyslaw Nalewaj
2026-12-03  2:18   ` [PATCH net-next v19 14/15] net: dsa: realtek: rtl8365mb: use PCP numbering on family D Mieczyslaw Nalewaj
2026-12-03  2:18   ` [PATCH net-next v19 15/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-12-04  2:18     ` netdev-bot+sashiko
2026-12-04  6:21       ` Mieczyslaw Nalewaj
2026-12-03 14:24   ` [PATCH net-next v19 00/15] " Linus Walleij
2026-12-03 15:11     ` Mieczyslaw Nalewaj
2026-12-03 15:31       ` Andrew Lunn

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=77de5e70-b66f-4ac7-a28c-2dff6f6ec57b@yahoo.com \
    --to=namiltd@yahoo.com \
    --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=netdev-bot+sashiko@kernel.org \
    --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