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=1796051568; b=UPJsvXfWQQDZNc5IE9v31rxeeUl2a9iF4c/NlzSQYKMco+XJtAjr5TL5VWy4/pwr6dUn 4L4LLfCsMWQhr/tvujufSrHeed3b3bXNqScSyjKJWcLsSVi63cuhInkn7dcTWQ4A7kImf AokQyQLud/nnVwqysSvvoCSuIa7jNRBlJAT+Jh9IVii6fagC5bhvGieumZvAnYZi+xn25 t6fF9HMxLYjRtB4LHBBGHk9V9NiZxmR8BLPxG9bFQAlVkGG7rKkOzsaTOJcVl/Wve34bX F1zuqK6bPXHL1nnBi3aff+p7pBvxF5GSeP6Hmreum7czLWWxgDiKIlpQUp8sYg4CeEg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796051568; 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=+U9wfuqVmW1qSkfeNlxjKChieGJ8Gcx4PMYSTerb754=; b=sOkNBKjaVLf+oZtA+puQFatoPQwLmJZ/p4gsEQQ1sVYR16SOcObdfQq2yXJRotN0N4RI FNQZyG/o2s7GxqW7XXQok3GjyvE+1mK4XLH1jusnkbWFkApxa+RwRXB48wiQHZpaSZkVS oSNFpkAkka82a6BTMAHjzPPXOek8rC9T5pPW4AvRP14x9yBUnQmqtg+1RfFCGzuKXD3Zq CRuGNTYjRm2HBLTHudoHWAvME7Q5MxZLVC2w0TDc1E+ehScV9iq7ilDo5NFNa3Qf7t1zl go6dl4dmWf63SQYRu8AKJ4reXjl7JF5y/Jf+Hx6bOsKQwMKYHwTZ1gPmSAb8++pEfSQ== 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=LxiaP8+n; 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 2D17F606A33C; Mon, 30 Nov 2026 15:12:48 +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=LxiaP8+n Received: by smtp.kernel.org (Postfix) with ESMTPSA id E82C21F00896; Mon, 30 Nov 2026 15:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796051568; bh=+U9wfuqVmW1qSkfeNlxjKChieGJ8Gcx4PMYSTerb754=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=LxiaP8+n9fTFMz4lqXGPamBrG51Y5CiKDXVRtt0kp7YafuAtygD4/0HldxFPU9z2Y qWZmh1x9Txj/JUqUBoXJ1omFKxj0GHkJzTphN3mqjhhtTPkL96Vqxmb9GZX2Iww/AI NiXIszS5lBVE9XG+aT8GXyReBr/nFA663MeknO28CoKaF2gQN+zrez/uov5c2ZuvNk 407pih2cTaPjZW1U63fqov+FHT2CxqvZapdprOfNPXaA5ZTZ1b+V/xkaF435+yvKKJ GeRHY0DAqnQApQPdd9g2SeLTZRjIQgkpg2YyAgpA7sEsh8fUzFBM4fn6ON65tvfJw4 6dsEFT1zeBj8Q== Subject: Re: [PATCH net-next v16 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: Mon, 30 Nov 2026 15:12:46 +0000 Message-ID: <179605156649.3146.10383763580449481811@kernel.org> In-Reply-To: References: 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 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 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 the SerDes port (port 6, SGMII/2500base-x) still advertises MAC_SYM_PAUSE | MAC_ASYM_PAUSE to phylink. - [Low] In drivers/net/dsa/realtek/rtl8365mb_main.c, two new family D definitions name the same SerDes in contradictory ways. -- net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support This commit extends the rtl8365mb SGMII/HSGMII PCS code to family D switches. On these switches the CPU SerDes is reached through the indexed SDS13 window, and SDS_MISC has a different layout. It adds family D tuning tables, an index argument for the SDS indirect accessors, and family D branches in pcs_config(), pcs_get_state(), pcs_link_up(), get_caps() and mac_link_up(). > diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c > index 7500ea9b3a627..59901e683dca1 100644 > --- a/drivers/net/dsa/realtek/rtl8365mb_main.c > +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c [ ... ] > @@ -334,7 +340,25 @@ > #define RTL8365MB_SDS_OPTION_ARM_KEY 0x0249 > #define RTL8365MB_SDS_OPTION_REG 0x13C1 > > +/* Family D uses the SDS13 indirect window for its MAC6 SerDes. > + * RTL8365MB_SDS_MISC_REG is at the same register address as on family C > + * in the vendor RTL8367D API, with the bit layout below. > + */ > +#define RTL8365MB_D_SDS_EXT0_INDEX 13 > +#define RTL8365MB_D_FIBER_CFG2_REG 0x13E8 > +#define RTL8365MB_D_FIBER_CFG2_RX_DISABLE_MASK GENMASK(7, 6) > +#define RTL8365MB_D_FIBER_CFG2_RX_DISABLE_SDS0 BIT(6) > +#define RTL8365MB_D_SDS_MISC_PA33PC_EN BIT(11) > +#define RTL8365MB_D_SDS_MISC_PA12PC_EN BIT(10) > +#define RTL8365MB_D_SDS_MISC_MAC6_SEL_SDS0 BIT(9) [ ... ] > @@ -1575,34 +1663,58 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode, > > /* Tune the SerDes with vendor-prescribed parameters */ > for (i = 0; i < sds_jam_size; i++) { > - ret = rtl8365mb_sds_write(priv, sds_jam[i].reg, > - sds_jam[i].val); > + ret = rtl8365mb_sds_write(priv, sds_index, > + sds_jam[i].reg, sds_jam[i].val); > + if (ret) > + return ret; > + } > + > + /* Family-specific post-tuning configuration */ > + if (is_d) { > + /* The register and field names follow the vendor RTL8367D API, > + * whose SDS numbering differs from the SDS13 window used > + * here. As in the vendor sequence the whole 2-bit field > + * (bits 7:6) is written, so bit 7 is cleared as well. > + */ > + ret = regmap_update_bits(priv->map, RTL8365MB_D_FIBER_CFG2_REG, > + RTL8365MB_D_FIBER_CFG2_RX_DISABLE_MASK, > + RTL8365MB_D_FIBER_CFG2_RX_DISABLE_SDS0); > if (ret) > return ret; > + > + 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; [Severity: Low] This isn't a bug, but the two new family D names used here seem to contradict each other: - RTL8365MB_D_SDS_MISC_MAC6_SEL_SDS0 (BIT(9) of SDS_MISC) reads as muxing MAC6 to SDS0. - RTL8365MB_D_FIBER_CFG2_RX_DISABLE_SDS0 (BIT(6) of 0x13E8) reads as disabling RX on that same SDS0. Read literally, rtl8365mb_pcs_config() selects SDS0 for MAC6 and disables its receiver in the same bring-up sequence. The comment above says the names follow the vendor RTL8367D API, whose SDS numbering differs from the SDS13 window. Both macros use the vendor naming, though, so the comment doesn't explain why they conflict. Could the definitions be renamed? Or could the comment say which SerDes or path bit 6 actually disables, for example only the fiber RX path? [ ... ] > @@ -1982,10 +2131,17 @@ static void rtl8365mb_phylink_get_caps(struct dsa_switch *ds, int port, > } > > if (extint->supported_interfaces & RTL8365MB_PHY_INTERFACE_MODE_SGMII && > - mb->sds_supported) > + mb->sds_supported) { > __set_bit(PHY_INTERFACE_MODE_SGMII, > config->supported_interfaces); > > + /* The SerDes rate is not programmed for 10 and 100 Mbit/s on > + * family D, see rtl8365mb_pcs_link_up(). > + */ > + if (rtl8365mb_is_d(priv)) > + config->mac_capabilities &= ~(MAC_10 | MAC_100); > + } [Severity: Medium] On family D, MAC_SYM_PAUSE and MAC_ASYM_PAUSE are still set in mac_capabilities for the SerDes port. Will pause actually take effect on that port? With this patch, rtl8365mb_phylink_mac_link_up() skips the SerDes pause enables on family D: if (rtl8365mb_interface_is_serdes(interface) && !rtl8365mb_is_d(priv)) { u32 val = 0; if (tx_pause) val |= RTL8365MB_SDS_MISC_SGMII_TXFC_MASK; That leaves only the TXPAUSE/RXPAUSE bits that rtl8365mb_d_ext_config_forcemode() writes into the MAC force register. The family C comment in the same function says flow control testing showed pause frames are only sent when the SerDes TXFC bit is set. It also says the MAC force pause bits alone have no effect on the SerDes port. The commit message drops 10 and 100 Mbit/s for the same reason: "It is not known whether the SerDes follows that register" It also says: "Flow control on the family D SerDes port has not been tested." If the family D SerDes behaves like family C, phylink would resolve tx_pause and rx_pause as enabled and advertise pause to the link partner. ethtool -a would report pause as on, but no pause frames would be sent. Should MAC_SYM_PAUSE | MAC_ASYM_PAUSE also be cleared on family D until flow control on this port has been checked? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/aebcc7f6-d5f8-4157-b63a-e2e707d9859b%40yahoo.com