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=1796255936; b=OFD+lUemJxk28AmsutJmdFlAUGVO4120JfdUOu5G5f/dk83jtkfDH6/bxMHJD/1+Tq8x R8hbjQOh+CRtREx8Nh8GmXEDmFHu0df5CCkpHusw/wumg+9wQ4h+MB2PSiqPNzxu/z75D 3XM94VyiC1myzDY9q1q7gvzB5e70uluLtpO+Uv1T3Enm/VEMIX0IEVEv4fX+14bW9eT8N qaaLNn7EUCEepmQztM4HYiqp2FL7kTzw8T+3nyzvOaOxlijlpAbD+u5Kf7DiYE8EaG31x U79POvPwTr+vRsHLeQlyd/i+L8hIM+4K1stSpyW7wvlsjgVy8TeWuGiEisiavY2J1IQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255936; 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=v6SXYmiLS8YfpZnU4cjPE7W9aVB0a10oBbR2MrvMm3Y=; b=IkNepi/bKH9/NYjIgAmD9+y5z0fouLox5QlAw8pD8gkRXS76+bTYLxFb+IqlrCZzMHng VuDTT9KfT76Dn7lCwIkXuiNoi+A4vVOvSZ1Xq2BAnReg7tLqibzzPbArmdgxnSqfp1i0g z2XJk7yQR7p2glwrWZ/2ulFrnwVQeTdcZq1HbaMxAuWsmP73+Q+SYCm8aATk3BiDIkK7m s1lputWoscsLODeOpZxgrrJKHYRijE2ZS6OYm+qkKfUTkHAqW/Xm9i43zRl08bFzmia9r wT+v/hyieND7lHhbC6jtUApq0B+6JWyQku0pLmI2xK/s4Yap5gk33ve0CHzA9EC/V4Q== 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=nhWNeBJW; 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 D53B7606A338; Wed, 2 Dec 2026 23:58:56 +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=nhWNeBJW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6073E1F00893; Wed, 2 Dec 2026 23:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796255936; bh=v6SXYmiLS8YfpZnU4cjPE7W9aVB0a10oBbR2MrvMm3Y=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=nhWNeBJWejaZBjSM4ME9avKSBd6vQ+h12DydYCBBYHKGkQFv+lnh78cOypZcSk93o ngBAMGLK+vqa1LGpgNiLbrgU5quYI34C0OLXeRTynrTHZieYvfau5CtzGCL27iEbB/ VJJzz55VITItlR1Au4aBpSDR4VaLK1shCDMHQsUPct+0cjEqLpCnAbIQaByU2mUulh pgIC/Kg29UXweMT5GVBA1o95z/2HaiO/flPntlzFdXmbIqCgCMURIgTbUW7L+kXCxC Ex7zfuDKjswO3BrBFVl/pTnP3pqvV9+Pp+/QmVC3027m1V/+NaIYDdfGrACHzqdzxO wINwem+bFoNnA== Subject: Re: [PATCH net-next v18 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: Wed, 02 Dec 2026 23:58:54 +0000 Message-ID: <179625593492.3146.17769311237884164405@kernel.org> In-Reply-To: <61c88068-ea97-4fd2-99d1-cb5abccd0694@yahoo.com> References: <61c88068-ea97-4fd2-99d1-cb5abccd0694@yahoo.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@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() (drivers/net/dsa/realtek/rtl8365mb_main.c) skips the… -- net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support This commit adds family D support to the existing RTL8367S SGMII/HSGMII PCS code. The family D CPU SerDes is reached through the indexed SDS13 window, and SDS_MISC uses a different layout. The family D paths get separate tuning tables and their own SDS_MISC setup, and the family D SerDes port no longer writes DIGITAL_INTERFACE_SELECT or advertises 10/100 Mbit/s. > diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c > index 7500ea9b3a627..da0c5f254560f 100644 > --- a/drivers/net/dsa/realtek/rtl8365mb_main.c > +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c [ ... ] > @@ -1575,34 +1663,63 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode, [ ... ] > 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 configures the SerDes mode directly; id (1) > + * refers to RGMII port 7 on RTL8367S-VB and must not be overwritten. > + */ > + 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, rtl8365mb_pcs_config() now skips the whole DIGITAL_INTERFACE_SELECT update. Should it write the EXT0 field instead? The RTL8367S-VB chip entry describes the SerDes as extint id 0: { 6, 0, PHY_INTF(SGMII) | PHY_INTF(HSGMII) }, That is the EXT0 field, bits 3:0 of RTL8365MB_DIGITAL_INTERFACE_SELECT_REG0 (0x1305). Nothing on the family D path writes that field in SGMII or 2500base-x mode. The reason given for skipping is that id 1 is the RGMII port 7. That argues for writing id 0 rather than skipping the write altogether. Family C sets up this register in two places: the init jam writes { 0x1305, 0xC000 }, and pcs_config() writes the SerDes mode into EXT1. Family D has no init jam table. The register is still used on family D, because rtl8365mb_ext_config_rgmii() writes the EXT1 field for RGMII on port 7. Suppose the EXT0 power-on or strap default on some board is not a SerDes mode. Could MAC6 then fail to connect to the SerDes and the CPU link stay down, even though SDS_MISC has MAC6_SEL_SDS0 and the mode field set? The commit message says: The EXT0 field of that register keeps its reset or bootloader value. Can a bootloader value survive here? rtl8365mb_setup() calls rtl8365mb_reset_chip() before any PCS configuration: priv->write_reg_noack(priv, RTL8365MB_CHIP_RESET_REG, FIELD_PREP(RTL8365MB_CHIP_RESET_HW_MASK, 1)); ... return regmap_read_poll_timeout(priv->map, RTL8365MB_CHIP_RESET_REG, val, !(val & RTL8365MB_CHIP_RESET_HW_MASK), 20000, 1e6); That is a full hardware reset, so it looks like EXT0 will always hold its power-on or strap default when rtl8365mb_pcs_config() runs. The commit message also says it was not verified whether the vendor RTL8367D sequence programs this field. The new source comment, however, says that SDS_MISC configures the SerDes mode directly, as if that were established. It also does not mention that EXT0 is left unprogrammed. Could the comment say both of those things, so it matches the commit message? This code is unchanged at the end of the series. The RTL8367S-VB chip entry makes this path reachable, and no later patch in the series programs EXT0. > > /* Take the SerDes out of reset. The vendor driver does this only > * after the SerDes mux and the interface mode are configured. > */ [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1%40yahoo.com