Article View: linux.kernel.netdev
Article #26037Re: [PATCH net-next v18 05/15] net: dsa: realtek: rtl8365mb: set RGMII mode for family D
From: netdev-bot+sashiko
Date: Wed, 02 Dec 2026 23:58
Date: Wed, 02 Dec 2026 23:58
109 lines
11953 bytes
11953 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] On family D EXT1, rtl8365mb_ext_config_rgmii()
(drivers/net/dsa/realtek/rtl8365mb_main.c) sets TOP_CON0.MAC7_SEL_EXT1โฆ
--
net: dsa: realtek: rtl8365mb: set RGMII mode for family D
On family D, this patch sets up the EXT1 pad drive and slew controls,
clears the EXT1 RGMII TX delay field, binds the shared pins to MAC7 and
disables SerDes 1 before it selects RGMII. It also stops advertising
RGMII on port 7 in phylink_get_caps() when MAC4 already owns the EXT1
pins.
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 5c2e47074de4b..e239894392410 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
[ ... ]
> @@ -1279,6 +1310,54 @@ static int rtl8365mb_ext_config_rgmii(struct realtek_priv *priv, int port,
> if (ret)
> return ret;
>
> + if (rtl8365mb_is_d(priv) && extint->id == 1) {
[ ... ]
> + /* Bind the RGMII/MII pins to MAC7. MAC4 does not own them:
> + * RGMII is not advertised otherwise, see
> + * rtl8365mb_phylink_get_caps().
> + */
> + ret = regmap_update_bits(priv->map,
> + RTL8365MB_D_REG_TOP_CON0,
> + RTL8365MB_D_MAC7_SEL_EXT1_MASK,
> + RTL8365MB_D_MAC7_SEL_EXT1_MASK);
> + if (ret)
> + return ret;
> +
> + ret = regmap_update_bits(priv->map,
> + RTL8365MB_D_REG_SDS1_MISC0,
> + RTL8365MB_D_SDS_MISC_MODE_FIELD_MASK,
> + RTL8365MB_D_PORT_SDS_MODE_DISABLE);
> + if (ret)
> + return ret;
> + }
> +
> ret = regmap_update_bits(
> priv->map, RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(extint->id),
> RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(extint->id),
[Severity: Low]
Should SerDes 1 be disabled before TOP_CON0.MAC7_SEL_EXT1 is set, and not
after?
The commit message says:
The TX delay field, the pin mux and the SerDes 1 disable are all
programmed before RGMII is selected, so the shared pins are never
driven by RGMII and SerDes 1 at the same time.
That only holds if the EXT1 nibble of DIGITAL_INTERFACE_SELECT is not
already RGMII when rtl8365mb_ext_config_rgmii() is entered. Nothing here
reads or clears that nibble first. After rtl8365mb_reset_chip() its value
comes from straps or EEPROM, and the commit message itself says the
driver should not rely on those defaults.
If that nibble is already RGMII and SerDes 1 is enabled, the pins are
owned by both MAC7 RGMII and SerDes 1 between the TOP_CON0 write and the
SDS1_MISC0 write.
There is a second way to end up in the same state. If the SDS1_MISC0
regmap_update_bits() fails, the function returns with the pins muxed to
MAC7 and SerDes 1 still enabled, and the TOP_CON0 change is not undone.
The caller only logs the failure and returns void:
rtl8365mb_phylink_mac_config() {
...
ret = rtl8365mb_ext_config_rgmii(priv, port, state->interface);
if (ret)
dev_err(priv->dev,
"failed to configure RGMII mode on port %d: %pe\n",
port, ERR_PTR(ret));
return;
...
}
phylink then goes on to mac_link_up() with the pins in that state.
If the SDS1_MISC0 write is moved ahead of the TOP_CON0 write, the window
is gone whatever the entry state is. A failure part way through would
then leave the pins with no owner instead of two.
Whether such a strap state exists, and whether brief contention matters
physically, depends on hardware behaviour that could not be checked
against the vendor RTL8367D API. Even so, the guarantee in the commit
message seems stronger than the code provides.
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1%40yahoo.com
Technical Details
Message-ID:
<179625593152.3146.8730462280005903743@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376135-linux-kernel-netdev=dewy.ruReferences:
<266ef365-4cbf-47c4-b92c-16d2935a44d2@yahoo.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376135-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v18 05/15] net: dsa: realtek: rtl8365mb: set RGMII mode for family D Date: Wed, 02 Dec 2026 23:58:51 +0000 Organization: Usenet Network Message-ID: <179625593152.3146.8730462280005903743@kernel.org> References: <266ef365-4cbf-47c4-b92c-16d2935a44d2@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2091963"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:MW9fm5aPWky01ZXxF6L/qKIrjfo= sha256:fDIZjlpeMaPoUQnr6ppwbyCyyfXNy34kixRm208iFSo= sha1:pPu1pxIcmJJ/iOkaoHOdVt30Dq4= sha256:s9w9vs/NF4l/H+w0FlqG9QJKpzXkobrrWwQUN0+TWGM= 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 2CC4F1177A6; Thu, 3 Dec 2026 02:59:17 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, 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 bTAxqRUBdqKT; Thu, 3 Dec 2026 02:59:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376135-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 9DF1611775E; Thu, 3 Dec 2026 02:59:04 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 0ED44291D9; Wed, 2 Dec 2026 23:59:01 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796255939; b=aHzWwwjbklW96DL7U0SOFrg4ax5nFIIaqZSbaQ4LJzZFfV63ddN31BAM2Y0UhufezbDg YKVh6vTKW88qgc88EsSFoeHlM/NsYVixsffl8WTOJw1vSnqKx00Z0YUfHapmZo2loV3Ws xhCffxRk2Bg5wIG+AVwRwHS2LsZZUH2EB99fPPMklMxBrqL6Lb7y7UdqYIfQToZbtf0q/ y9jxcQUjINQAFzTlJpMbvi5jErUIGvqd+IKq7jS1AYxf5BKx70O5cq7yfl3KQ1xsNYoZm PmTDvhQkAuRp50vtQi9WLtJ/OWanjGmrGhc3w2J/l+KViV/c18He3TrU6f5k4btmPow== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255939; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=4cKmH/ZeXeLS8LebjV+MAm3iLvyGXh27nFew3cwH/oU=; b=NDOzbe4V9oT8C13cq3kMyVNo+C7F1pMvpqtKAk+mAM64cMcSq/hl/riWn4Ijw71XLARl p9y2hhI06iT0vR0VFjpB4N1MintaV1vkGEEs1PI5PW+qWrziQPf4VHE2YF0kSi5edcn/8 SE5rYZr3Fu2fmEiNvJ0P8jHRWEXWvZPr6Ot2HvrSWMUO12xuGSk3vGZnEFmRgUiBe+PQo W00/919hQbcTXEtLvUc0pr8Oyar2lnB9z06ieW9MQwhqPpb6dKpyw/YmdqwI7FkY/d4YY n0ee5Oyw47HK+2rftXFJjo80tne2nWqMsArkNqKsVwjH/L9dC+mV0JzwDegp/+l2Wiw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="I4adJ/cO"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5196D606A681; Wed, 2 Dec 2026 23:58:59 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I4adJ/cO X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796255933; b=DN/uR0pKBP4yC+pEUVtDp9fV+iqFlecBSC+YOBerf/jXR64yD0f6mts2YsrOxj+qLKaS 8jNjmGmuHSPWFNbSDDJrw04yvzX1+cCNtmOOl4Pi1KhCf5n884CIZSNz6T/IvZlAazX9Q tcA+3DOhmm/w/YDjIqTgDHDEAuQBuBimr/4tyi0YwYtNB2bt7PQUxpkncXi8UTdwnERNP fzSpnp9yes1X9RsIOXK2Lx11P9h5RuwD0QfjLCSgBAEbf53rkM0PWCTojVzuLTBmTbDm1 +idkv8h/13Oc+O7L6HnTpe1URuh/Mv5M0cpC77fQuZw4QaQ+1pLAfIqZmsKaM0YoHrQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255933; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=4cKmH/ZeXeLS8LebjV+MAm3iLvyGXh27nFew3cwH/oU=; b=HBdk4fAOZnIvNfPRF7uvyfjan+XTdTMNyZ82fNwk3PFRRB3CLZuWDqRETTbmrCDOwytS 5FfbbbefMFXmD/gQ9bh1ZioXOrsj8jYH+chorkx6dnHyvwmJlDolRbfGhVrZRhgzRKTxa iDINvOy3YatYE0OjsQ89LJhHabM6JNWj2u2a9/jpKXeh0u87BKm4mojNgAguVRP+st8Qg Au3C2F0xPig+arugc/8phPe7lTiD5zkloMsTdS7P5xXpYgm+eMn1M5G3xCeyrUcfw68Ha hdgOCLi7m19C1M8PEFQREgCZVLXRNhC0LuWK4pE+P+65xrwVp1iQjOu2iXr3cb0bQKw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="I4adJ/cO"; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F070606A322; Wed, 2 Dec 2026 23:58:53 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 027371F00896; Wed, 2 Dec 2026 23:58:51 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796255933; bh=4cKmH/ZeXeLS8LebjV+MAm3iLvyGXh27nFew3cwH/oU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=I4adJ/cOeU9/E2EXpvDkFIEYah95pw6nQrHJdH7PdCG8yTFV1LryH4YekPzokSHC3 7NrphaXUCvT6gd5AGbusmM2JgXUbi6DEwO/9WWzsISg1LQhpD6cP7nVRvds92FO0z7 whWlOI0RfdQRsr3slhbawkrgCBdsmCZWTA0R+6rmHVVrZMN3gyGr5nUVVNO07pKO6I bHEX9/NS0sQZ3FfWnhL7x6g5aEZR4VwKliCK0NIf9clUf9glhPFK9Mj1akWe+uTKJn U3ryXqYxFPKfPZ5k+Jt0W9Bt4P2RJRbug6v1vl1jfSMsweo5j4JdN3eGznx9rAhSEz d7kh7x3nBB9Dw== 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, alvin.sipraga@analog.com, gusfmora@gmail.com, kuncy7@gmail.com, fabianotassotti@gmail.com, gabonpivovich@gmail.com, contact@c127.dev, o.rempel@pengutronix.de X-In-Reply-To: <266ef365-4cbf-47c4-b92c-16d2935a44d2@yahoo.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list