From: sashiko-bot@kernel.org
To: "Mohd Ayaan Anwar" <mohd.anwar@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH RFC net-next 2/9] net: pcs: xpcs: add USXGMII Clause 37 autoneg support
Date: Thu, 24 Sep 2026 01:09:43 +0000 [thread overview]
Message-ID: <20260924010943.B6DA21F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260923-qcom_xpcs_nord_emac-v1-2-4b1c682af70f@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] net: pcs: xpcs: USXGMII link up forces full-duplex and ignores negotiated duplex
- [Low] net: pcs: xpcs: unconditional disable of Clause 37 AN interrupts for USXGMII
- [Low] net: pcs: xpcs: incorrect use of standard MDIO_CTRL1 in vendor-specific register access
--
commit a4e7caa76a7f032f82d43f5626c2004e96588abf
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
net: pcs: xpcs: add USXGMII Clause 37 autoneg support
This commit adds Clause 37 USXGMII auto-negotiation support to the generic
DesignWare XPCS driver. It configures the PCS for BASE-R, enables single-port
10G-SXGMII operation, and decodes the negotiated link, speed, and duplex.
> diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
> index 0337e2bcc0125..7f5c7a275630f 100644
> --- a/drivers/net/pcs/pcs-xpcs.c
> +++ b/drivers/net/pcs/pcs-xpcs.c
[ ... ]
> @@ -355,6 +356,54 @@ static int xpcs_read_fault_c73(struct dw_xpcs *xpcs,
> return 0;
> }
>
> +static int xpcs_config_aneg_c37_usxgmii(struct dw_xpcs *xpcs)
> +{
> + u16 mask, val;
> + int ret;
[ ... ]
> + /* Configure USXGMII per XPCS databook section 7.6. */
> + mask = DW_VR_MII_AN_CTRL_8BIT | DW_VR_MII_SGMII_LINK_STS |
> + DW_VR_MII_TX_CONFIG_MASK | DW_VR_MII_PCS_MODE_MASK |
> + DW_VR_MII_AN_INTR_EN;
> + val = FIELD_PREP(DW_VR_MII_TX_CONFIG_MASK,
> + DW_VR_MII_TX_CONFIG_PHY_SIDE_SGMII) |
> + DW_VR_MII_SGMII_LINK_STS;
> +
> + ret = xpcs_modify(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL,
> + mask, val);
[Severity: Low]
Does this unconditionally disable Clause 37 AN interrupts for USXGMII?
DW_VR_MII_AN_INTR_EN is included in the mask but is missing from val, which
explicitly and unconditionally clears the interrupt enable bit.
Although USXGMII currently defaults to polling mode, could explicitly disabling
it here break interrupt-driven operation if a MAC driver attempts to use it?
> + if (ret < 0)
> + return ret;
> +
> + return xpcs_modify(xpcs, MDIO_MMD_VEND2, MII_BMCR,
> + BMCR_ANENABLE, BMCR_ANENABLE);
> +}
> +
> static void xpcs_link_up_usxgmii(struct dw_xpcs *xpcs, int speed)
> {
> int ret, speed_sel;
[Severity: Low]
Is the standard MDIO_CTRL1 macro used incorrectly here for a vendor-specific
register?
In xpcs_link_up_usxgmii(), there are calls like:
ret = xpcs_modify_vpcs(xpcs, MDIO_CTRL1, DW_USXGMII_EN, DW_USXGMII_EN);
Both MDIO_CTRL1 and DW_VR_XS_PCS_DIG_CTRL1 evaluate to 0x00, but using the
standard IEEE macro instead of the vendor-specific one in xpcs_modify_vpcs()
breaks consistency. This also occurs when applying DW_USXGMII_RST.
[ ... ]
> @@ -1158,6 +1213,58 @@ static int xpcs_get_state_2500basex(struct dw_xpcs *xpcs,
> return 0;
> }
>
> +static int xpcs_get_state_c37_usxgmii(struct dw_xpcs *xpcs,
> + struct phylink_link_state *state)
> +{
> + u16 speed;
> + int ret;
[ ... ]
> + state->duplex = ret & DW_VR_MII_USXG_FULL ?
> + DUPLEX_FULL : DUPLEX_HALF;
> +
> + return 0;
> +}
[Severity: Medium]
Will xpcs_link_up_usxgmii() ignore this negotiated duplex state?
If the link negotiates half-duplex (which is supported here as DUPLEX_HALF),
the xpcs_link_up() function passes this state, but xpcs_link_up_usxgmii()
ignores the duplex parameter entirely and unconditionally sets DW_USXGMII_FULL.
Furthermore, DW_USXGMII_FULL is missing from DW_USXGMII_SS_MASK:
ret = xpcs_modify(xpcs, MDIO_MMD_VEND2, MII_BMCR, DW_USXGMII_SS_MASK,
speed_sel | DW_USXGMII_FULL);
Is it impossible to clear the full-duplex bit if it was previously set,
leading to a duplex mismatch?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260923-qcom_xpcs_nord_emac-v1-0-4b1c682af70f@oss.qualcomm.com?part=2
next prev parent reply other threads:[~2026-09-24 1:09 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 1:07 [PATCH RFC net-next 0/9] net: introduce Qualcomm XPCS support and add Nord Ethernet plumbing Mohd Ayaan Anwar
2026-09-23 1:07 ` [PATCH RFC net-next 1/9] dt-bindings: net: pcs: add Qualcomm Nord XPCS Mohd Ayaan Anwar
2026-09-23 1:07 ` [PATCH RFC net-next 2/9] net: pcs: xpcs: add USXGMII Clause 37 autoneg support Mohd Ayaan Anwar
2026-09-23 13:31 ` Mohd Ayaan Anwar
2026-09-24 1:09 ` sashiko-bot [this message]
2026-09-23 1:07 ` [PATCH RFC net-next 3/9] net: pcs: xpcs: add custom platform register accessors Mohd Ayaan Anwar
2026-09-23 12:18 ` Andrew Lunn
2026-09-23 12:37 ` Mohd Ayaan Anwar
2026-09-25 10:18 ` Lorenzo Bianconi
2026-09-23 1:07 ` [PATCH RFC net-next 4/9] net: pcs: xpcs: add Qualcomm Nord platform support Mohd Ayaan Anwar
2026-09-23 12:07 ` Andrew Lunn
2026-09-23 12:57 ` Mohd Ayaan Anwar
2026-09-24 1:09 ` sashiko-bot
2026-09-25 10:37 ` Lorenzo Bianconi
2026-09-23 1:07 ` [PATCH RFC net-next 5/9] net: pcs: xpcs: initialize runtime PM as suspended Mohd Ayaan Anwar
2026-09-25 11:03 ` Lorenzo Bianconi
2026-09-23 1:07 ` [PATCH RFC net-next 6/9] dt-bindings: net: qcom,ethqos: add Qualcomm Nord Mohd Ayaan Anwar
2026-09-24 1:09 ` sashiko-bot
2026-09-23 1:07 ` [PATCH RFC net-next 7/9] net: stmmac: support custom XGMAC register layouts Mohd Ayaan Anwar
2026-09-24 1:09 ` sashiko-bot
2026-09-25 12:22 ` Lorenzo Bianconi
2026-09-23 1:07 ` [PATCH RFC net-next 8/9] net: stmmac: qcom-ethqos: support external PCS Mohd Ayaan Anwar
2026-09-24 1:09 ` sashiko-bot
2026-09-28 15:15 ` Maxime Chevallier
2026-09-23 1:07 ` [PATCH RFC net-next 9/9] net: stmmac: qcom-ethqos: add Qualcomm Nord support Mohd Ayaan Anwar
2026-09-24 1:09 ` sashiko-bot
2026-09-25 13:02 ` Lorenzo Bianconi
2026-09-23 8:50 ` [PATCH RFC net-next 0/9] net: introduce Qualcomm XPCS support and add Nord Ethernet plumbing Zhangfei Gao
2026-09-23 15:15 ` Andrew Lunn
2026-09-28 10:21 ` Krzysztof Kozlowski
2026-09-23 9:41 ` Maxime Chevallier
2026-09-23 10:43 ` Mohd Ayaan Anwar
2026-09-23 13:17 ` Coia Prant
2026-09-23 14:03 ` Mohd Ayaan Anwar
2026-09-24 5:54 ` Coia Prant
2026-09-23 18:35 ` Andrew Lunn
2026-09-24 5:25 ` Coia Prant
2026-09-23 18:40 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260924010943.B6DA21F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=mohd.anwar@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox