๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3136

Re: [PATCH net-next v5 9/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB

#3136
From: netdev-bot+sashiko
Date: Wed, 14 Oct 2026 08:56
112 lines
9587 bytes
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 family-D SerDes re-latch work can be queued again after
  the reboot notifier has cancelled it.

--

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

This patch adds the RTL8367S-VB (chip ID 0x6642, version 0x0010) to the
chip table. It is the first family D chip, so the family D handling added
in the earlier patches becomes reachable. On family D it also caps
priv->num_ports at RTL8365MB_D_MAX_NUM_PORTS.

> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 238a3fa765e97..352b15bd5508d 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c

[ ... ]

> @@ -885,6 +892,19 @@ static const struct rtl8365mb_chip_info rtl8365mb_chip_infos[] = {
>  		.jam_table = rtl8365mb_init_jam_8365mb_vc,
>  		.jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc),
>  	},
> +	{
> +		.name = "RTL8367S-VB",
> +		.chip_id = 0x6642,
> +		.chip_ver = 0x0010,
> +		.family = RTL8365MB_FAMILY_D,

[Severity: Medium]

With this entry, the family D SerDes re-latch work and the reboot notifier
can now run. Can the sds_relatch work be queued again after the reboot
notifier has cancelled it?

The notifier cancels the work once. It sets no state that anything else
checks:

drivers/net/dsa/realtek/rtl8365mb_main.c:rtl8365mb_sds_reboot_notify() {
	/* Runs before device_shutdown() on reboot, halt, power off and kexec.
	 * cancel_delayed_work_sync() waits for a running pass, so the SerDes
	 * is not left parked and the bus is not touched while it is shut down.
	 */
	cancel_delayed_work_sync(&mb->sds_relatch);
    ...
}

rtl8365mb_pcs_config() queues the work for 2500base-x on family D
without any check:

	if (is_d && interface == PHY_INTERFACE_MODE_2500BASEX) {
		WRITE_ONCE(mb->sds_relatch_count, 1);
		schedule_delayed_work(&mb->sds_relatch, 0);
	}

After that, rtl8365mb_sds_relatch_work() re-arms itself every time it
exits:

rearm:
	schedule_delayed_work(&mb->sds_relatch, delay);

pcs_config() could run after the reboot notifier chain in two ways:

- Probe overlaps reboot. rtl8365mb_detect() registers the notifier, and
  dsa_port_setup()->dsa_port_enable()->dsa_port_enable_rt()->
  phylink_start() then configures the HSGMII CPU port.
  kernel_restart_prepare() runs the notifiers before device_shutdown()
  calls wait_for_device_probe().

- A user port on the SerDes is brought up at the same time, through
  dsa_user_open()->phylink_start().

After that, rtl83xx_shutdown()->dsa_switch_shutdown() only closes the
conduits and detaches the user netdevs. It doesn't stop the CPU port
phylink, call rtl8365mb_teardown(), or cancel sds_relatch. The devm action
rtl8365mb_sds_relatch_cancel() doesn't run on shutdown either.

In that case, wouldn't the work keep parking SDS_MISC, sleeping for 20 ms
and doing regmap I/O over SMI/MDIO while the switch, and possibly the host
MDIO/GPIO controller, is being shut down? The notifier comment says this
cannot happen.

Would disable_delayed_work_sync() in the notifier work here? Another
option would be a shutdown flag that rtl8365mb_pcs_config() and the work
check before re-queueing.

> +		.extints = {
> +			{ 6, 0, PHY_INTF(SGMII) | PHY_INTF(HSGMII) },
> +			{ 7, 1, PHY_INTF(MII) | PHY_INTF(TMII) |
> +				PHY_INTF(RMII) | PHY_INTF(RGMII) },
> +		},
> +		.jam_table = rtl8365mb_init_jam_8365mb_vc,
> +		.jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc),
> +	},
>  };

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/aa5fa12c-e43e-4e5e-9f77-c6eaf477abc4%40yahoo.com
Technical Details
Message-ID: <179196820753.434549.9415507328931407333@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346122-linux-kernel-netdev=dewy.ru
References: <ecb73c8a-0bd7-4c82-8fa7-048aae4e335e@yahoo.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346122-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 9/9] net: dsa: realtek: rtl8365mb: add support
 for RTL8367S-VB
Date: Wed, 14 Oct 2026 08:56:47 +0000
Organization: Usenet Network
Message-ID: <179196820753.434549.9415507328931407333@kernel.org>
References: <ecb73c8a-0bd7-4c82-8fa7-048aae4e335e@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2253883"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:d83kMtjqlBMa0z74ZKt1c8pTq5A= sha256:9Jqfz+Dmy4IsEJzxwhltDK6cvj4GxpUVoEczkdpE644=
	sha1:DiI+xJEmnf0vp9yLbJsFw59UDwE= sha256:f00VTIuForwycsgkAS1aGnV6dxHNAdX1TEgFZ5pWVBA=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 3CC73110089; Wed, 14 Oct 2026 11:59:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.34
X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id BkdJjHkCkXiy;
	Wed, 14 Oct 2026 11:59:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-346122-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id ED660110085; Wed, 14 Oct 2026 11:59:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id ACB213F7BA; Wed, 14 Oct 2026 08:57:09 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 28E114D8D92;
	Wed, 14 Oct 2026 08:56:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AlIUGQ9+"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A7864D598B;
	Wed, 14 Oct 2026 08:56:48 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791968211; cv=none; b=mPtjHDlwvh7bJtNtJ9rKn7RJWoeMaAIK4/Vvlw5RiNlL85cn1sQ0nY0tYkgBsB3DVJ9kDhqfkxXF0FKq7cHCBZ2hbCsGlY3JmdVC5/S52E4MnGP78JVTV6TsQo1iZbCgK55HaZEPcS9ty9Utvnag+3u5QCmDi5UuVym5n5q/dmY=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791968211; c=relaxed/simple;
	bh=h7dCTuxTADoa2X7SkQp+Y9/dmH+Z4w2eIXNY+CpqW7Y=;
	h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References:
	 Content-Type:MIME-Version; b=L1L/M1qSTQ/1yGoS/cCY/Axz8rAsAp3zTzpJe3RVrp1SHiMe1Ly5V0GySO8pwcFuHI5gEIyP4kbQlAkO6C2w/u8gRwDetazdtbxkdCh2ViXByKZK2HDIEfV6sHrDg2/w1FQ2iMuWYhtMnlmgfhvh83luz0Y1EkJLjOSN/mjwfeI=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AlIUGQ9+; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03CCC1F00893;
	Wed, 14 Oct 2026 08:56:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791968208;
	bh=pVSFJOnLtTLLxLTcRLyMja2JHdb9/oY00VwBW3b5GOY=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=AlIUGQ9+cfU7Ywfidwob4ebZgm1NBCP15wD2PCvAR2beU9Mr4XgZmyG9ac7p3Sj6e
	 cQ+bkiscsVXjJi9kFGTN8FoRQDeinvqhZSfC7g52R2ziBW/B4phZhNhxW+DUmzP9gL
	 l9C4AK6KZ295PsnYuURO2/11Yu2P1bj5A9wuRYRRyYuMwLXWs+BZHuxne0njw08hI/
	 6Kx2YcYwLJK9xWPW5i6LQ5wc1/yxbTTn1MNcY4Ee3ON+JleIlhezL1CM7HZ2ay48NT
	 FulYAleqRA8tmiTp3+qzD2WW84DeC2i7xUXZEPGKmRo03H/v/mlrxOCcq8pwpmYPVK
	 0l2vKHIh3PCHQ==
X-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
X-In-Reply-To: <ecb73c8a-0bd7-4c82-8fa7-048aae4e335e@yahoo.com>
X-sashiko-severity: Medium
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>