The Linux Kernel Mailing 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 v13 14/14] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB
Date: Mon, 23 Nov 2026 09:51:44 +0000	[thread overview]
Message-ID: <179542750447.3135.8686604271395828150@kernel.org> (raw)
In-Reply-To: <2ec7a146-d353-4eb0-b0ac-a53d6a0a2838@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] The new rtl8365mb_family_d descriptor sets `.jam_table =
  rtl8365mb_init_jam_8365mb_vc`.

--

net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB

This patch adds the RTL8367S-VB (chip ID 0x6642) to the chip table. It is
the first chip to use the family D implementations added earlier in the
series. It also makes rtl8365mb_d_ext_config_forcemode() static and
updates the comments and the Kconfig help.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 75d9c6120e7ff..73563244f3be5 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -832,6 +844,24 @@ static const struct rtl8365mb_family_info rtl8365mb_family_c = {
>  	.l2_mc_to_data = rtl8365mb_c_l2_mc_to_data,
>  };
>  
> +static const struct rtl8365mb_family_info rtl8365mb_family_d = {
> +	.family = RTL8365MB_FAMILY_D,
> +	.jam_table = rtl8365mb_init_jam_8365mb_vc,
> +	.jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc),

[Severity: Medium]
Are the RTL8367C init values safe to write as they are on the family D
register map?

With this entry, rtl8365mb_setup()->rtl8365mb_switch_init() writes
rtl8365mb_init_jam_8365mb_vc to RTL8367S-VB. It then writes
rtl8365mb_init_jam_common, with no family check:

drivers/net/dsa/realtek/rtl8365mb_main.c:rtl8365mb_switch_init() {
    ...
	/* Common init jam */
	for (i = 0; i < ARRAY_SIZE(rtl8365mb_init_jam_common); i++) {
		ret = regmap_write(priv->map, rtl8365mb_init_jam_common[i].reg,
				   rtl8365mb_init_jam_common[i].val);
    ...
}

The commit message says the chip-specific table "has not been compared
with the vendor RTL8367D initialization". It does not mention that the
common table (0x1200, 0x0884, 0x06EB, 0x03FA, 0x08C8, 0x0A30, 0x0800,
0x0802, 0x09DA, 0x1D32) is applied to family D as well.

Several of these addresses are already treated as family D registers
elsewhere in the driver.

0x13F9 is RTL8365MB_D_REG_EXT_TXC_DLY and gets 0x0090:

	{ 0x13E2, 0x003F }, { 0x13F9, 0x0090 }, { 0x121E, 0x03CA },

That sets the EXT1 RGMII TX delay field [5:3] to 2. In
rtl8365mb_ext_config_rgmii(), that field is cleared only when EXT1 is
configured as RGMII. Everything else in the register keeps the jam value.

0x0A30 is RTL8365MB_D_LUT_CFG_REG and gets 0x020E (bits 1, 2, 3 and 9):

	{ 0x03Fa, 0x0007 }, { 0x08C8, 0x00C0 }, { 0x0A30, 0x020E },

rtl8365mb_d_lut_init() only clears bits 4 and 6, which the jam value does
not set anyway:

	ret = regmap_update_bits(priv->map, RTL8365MB_D_LUT_CFG_REG,
				 RTL8365MB_D_LUT_CFG_IPMC_HASH_MASK |
				 RTL8365MB_D_LUT_CFG_BCAM_DISABLE_MASK, 0);

So bits 1, 2, 3 and 9 keep the family C values. Their meaning on family D
is not documented.

0x1305 is RTL8365MB_DIGITAL_INTERFACE_SELECT_REG0 and gets 0xC000:

	{ 0x18E0, 0x4004 }, { 0x122B, 0x241C }, { 0x1305, 0xC000 },

The per-extint mode nibbles are rewritten later. Bits 15:14 stay set, and
their meaning on family D is unknown.

The remaining entries (0x13EB, 0x1303, 0x1304, 0x13E2, 0x121E, 0x1233,
0x1237, 0x1239, 0x123A, 0x0301, 0x1349, 0x18E0, 0x122B, 0x13F0, 0x1D32
and others) are undocumented RTL8367C values. The series has already
found that family D moved or repurposed nearby registers, for example
0x0A32 and 0x13E8.

The two tested boards use SGMII/HSGMII on port 6. Could these writes cause
problems in configurations that have not been tested, such as RGMII or MII
on port 7, or in multicast LUT handling?

Would it be better to give family D its own jam table based on the vendor
RTL8367D init sequence? Another option is to skip the entries in
rtl8365mb_init_jam_common that overlap family D registers. Failing that,
could the commit message at least say that the common table is also
applied unverified?

> +	.ext_config_forcemode = rtl8365mb_d_ext_config_forcemode,
> +	.vlan_4k_read = rtl8365mb_d_vlan_4k_read,
> +	.vlan_4k_write = rtl8365mb_d_vlan_4k_write,

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/3f1826f8-3096-40dd-a278-c70fce4852c8%40yahoo.com

      reply	other threads:[~2026-11-23  9:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3f1826f8-3096-40dd-a278-c70fce4852c8.ref@yahoo.com>
2026-11-22  9:35 ` [PATCH net-next v13 00/14] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-22  9:36   ` [PATCH net-next v13 01/14] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-22  9:37   ` [PATCH net-next v13 02/14] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-22  9:38   ` [PATCH net-next v13 03/14] net: dsa: realtek: rtl8365mb: refactor forcemode handling Mieczyslaw Nalewaj
2026-11-22  9:39   ` [PATCH net-next v13 04/14] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-22  9:41   ` [PATCH net-next v13 05/14] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-22  9:42   ` [PATCH net-next v13 06/14] net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling Mieczyslaw Nalewaj
2026-11-22  9:43   ` [PATCH net-next v13 07/14] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko
2026-11-22  9:44   ` [PATCH net-next v13 08/14] net: dsa: realtek: rtl8365mb: refactor PVID handling Mieczyslaw Nalewaj
2026-11-22  9:45   ` [PATCH net-next v13 09/14] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D Mieczyslaw Nalewaj
2026-11-22  9:46   ` [PATCH net-next v13 10/14] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko
2026-11-22  9:47   ` [PATCH net-next v13 11/14] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-11-22  9:48   ` [PATCH net-next v13 12/14] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko
2026-11-22  9:49   ` [PATCH net-next v13 13/14] net: dsa: realtek: rtl8365mb: use PCP numbering " Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko
2026-11-22  9:50   ` [PATCH net-next v13 14/14] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-23  9:51     ` netdev-bot+sashiko [this message]

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=179542750447.3135.8686604271395828150@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