From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796350731; b=b1R7PE3oGvF9yQtz0xIWoiiqigVFL6AnkfxSg+fRrFWbveTOruDtwZ/cn7gfTIftSyP4 EMygM0YjgpjId0Aw2M3ICstYRLurvHXum9AfpiD3EM7m+w9gR2it4nd0VD4eptzCDxj+8 Knq/jrOAidoSeAI0mDRhz8fiXcr1cjZZtVqM5n4FqexHWIOf9zLUDrxsmMacxSsmMJHqJ x9Btgq/pCkm6ZK1oKpWbs8+6s+Au4NTX/ECZ7uiq8ltDityvC2FmEMkMFhDUjHGGjRSHJ ofyDx8QWK+vZQ0lrxY50+Un+0C/VW9Uvv8UCGCvOSPTFI635YZRf4fOTqrr2WKuuYBA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796350731; 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=ggR3rayt6ljWGixmHN+zHiclfSKifQOC5mwy3Cwi3B8=; b=H3+hRfzDhW2cyNPd7x/NPheVVQQNiksFE3VinpOu6LgMVl2gbp7ZJ174Lu9ETwaqva0g ipV6gFWKr3y3QyIvghDtTDFe2il/CimqwLB8namVQCs77RgRkPB0aA6kvIXo9MUkGHB2x WAUa6mkiwbd0YQTYWzs9OpkPPlkJ7z1U+eyUtI4yEGJDqwGxZ+2LyP8rmZI1D7KYyMB6H fPMaCVMj1lrJw9ojp8nWJihmsP5ND2FacHil/x27JD1h2wTInmIQMQL9rKEyk18t6bg85 iiGANKTcLhEt3zblcgnsfIusLGzq8JZsSvDyyxKIt/DmxCsndqRGSe3YYScHm+H1Auw== 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=ZJkNgQD5; arc=none smtp.remote-ip=100.103.45.18 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 A267C606A322; Fri, 4 Dec 2026 02:18:51 +0000 (UTC) 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=ZJkNgQD5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 574841F000C2; Fri, 4 Dec 2026 02:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796350731; bh=ggR3rayt6ljWGixmHN+zHiclfSKifQOC5mwy3Cwi3B8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ZJkNgQD5TiGfh51JZEsetDfTq7A0bxBZ0H4KPP30W4CMj96XOaiPK0F66qp9WTf1R +/9Fdy0ZQu1hDIM49w9CrHGJsz2c+ebBXpKkfAxEbXOIbL7QTJ3QUpUk46vx8lISBR IXzalXS5wTiwpdgEqoTEF94LAo3vMLZseIVw+nq7IE5sayMi+elFrpMEeQ3Zoixl+6 vxsDAfm4z205OWP1gIonQkEvhs9+TOYEEHB9dIKdPfXXGywNEa3wlriWyCWcPz+5Rc Z5fjC3w/MyYCrwYLlMOak+U2EkOOYY/xQPaTTqEeApeq6KDLBfSUT2qt+7pewu9EN3 wYDNc+HsT+mzA== Subject: Re: [PATCH net-next v19 10/15] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support 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, o.rempel@pengutronix.de Date: Fri, 04 Dec 2026 02:18:49 +0000 Message-ID: <179635072993.3146.4719994977464012754@kernel.org> In-Reply-To: <68b3e791-8ac2-41fd-887f-b82a81d45338@yahoo.com> References: <68b3e791-8ac2-41fd-887f-b82a81d45338@yahoo.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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? [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/59c7992d-1c83-4bf1-a2f4-c853d4777190%40yahoo.com