From: sashiko-bot@kernel.org
To: "Coia Prant" <coiaprant@gmail.com>
Cc: neil.armstrong@linaro.org, olteanv@gmail.com, vkoul@kernel.org,
conor+dt@kernel.org, linux-phy@lists.infradead.org,
wsa+renesas@sang-engineering.com, robh@kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v5 06/11] net: pcs: xpcs: add ANRESTART support for SGMII link recovery
Date: Mon, 14 Sep 2026 19:44:21 +0000 [thread overview]
Message-ID: <20260914194421.944211F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260913185849.907479-7-coiaprant@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unconditionally applying the RK3568 SGMII AN restart quirk causes an infinite interrupt storm or workqueue loop on standard interrupt-driven DW XPCS configurations.
--
commit 78eb5488d0c0d3fe9f609e56e59710ced52856fa
Author: Coia Prant <coiaprant@gmail.com>
net: pcs: xpcs: add ANRESTART support for SGMII link recovery
This patch adds BMCR_ANRESTART to DW XPCS when configuring auto-negotiation
and when the link goes down. This is intended to resolve an issue on some
platforms (like RK3568) where the PCS does not automatically restart
auto-negotiation when the link goes down and comes back up.
> diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
> index 0337e2bcc0125..8c3875b6985b9 100644
> --- a/drivers/net/pcs/pcs-xpcs.c
> +++ b/drivers/net/pcs/pcs-xpcs.c
[ ... ]
> @@ -1093,9 +1107,18 @@ static int xpcs_get_state_c37_sgmii(struct dw_xpcs *xpcs,
> return 0;
> }
>
> - /* Clear AN complete status or interrupt */
> - if (state->an_complete)
> - xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS, 0);
> + if (state->an_complete) {
> + /* Clear AN complete status or interrupt */
> + ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS, 0);
> + if (ret < 0)
> + return ret;
> +
> + /* Initiate the next round of AN */
> + ret = xpcs_modify(xpcs, MDIO_MMD_VEND2, MII_BMCR, BMCR_ANRESTART,
> + BMCR_ANRESTART);
[Severity: Medium]
Could unconditionally applying this AN restart quirk cause an infinite
interrupt storm or MDIO polling loop on standard DW XPCS configurations?
If a cable is disconnected on an SGMII port, the PHY may continuously transmit
the 'Link Down' AN configuration word. When the MAC completes AN and generates
an interrupt, xpcs_get_state_c37_sgmii() is called. It clears the interrupt
and unconditionally sets BMCR_ANRESTART.
Will this cause the hardware to reset its AN state machine, immediately
complete AN again with the PHY's continuous 'Link Down' word, and fire another
interrupt, creating an endless loop?
Should this behavior be isolated to only the platforms that require the quirk
(like RK3568), rather than applied to all hardware using the DesignWare XPCS IP?
> + if (ret < 0)
> + return ret;
> + }
>
> return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260913185849.907479-1-coiaprant@gmail.com?part=6
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-09-14 19:44 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-13 18:58 [PATCH net-next v5 00/11] net: pcs: add basic support for RK3568 XPCS Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 01/11] net: stmmac: move XPCS lifetime management to platform drivers Coia Prant
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-15 10:21 ` Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 02/11] dt-bindings: phy: rockchip: naneng-combphy: add rockchip,sgmii-mac-sel property Coia Prant
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-15 10:22 ` Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 03/11] phy: rockchip: naneng-combphy: add SGMII MAC selection for RK3568 Coia Prant
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-15 10:26 ` Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 04/11] dt-bindings: net: pcs: add rockchip,rk3568-xpcs support Coia Prant
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-13 18:58 ` [PATCH net-next v5 05/11] arm64: dts: rockchip: rk3568: add XPCS and fixed-clock nodes Coia Prant
2026-09-14 19:44 ` sashiko-bot
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-13 18:58 ` [PATCH net-next v5 06/11] net: pcs: xpcs: add ANRESTART support for SGMII link recovery Coia Prant
2026-09-14 19:44 ` sashiko-bot [this message]
2026-09-15 10:35 ` Coia Prant
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-15 11:00 ` Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 07/11] net: pcs: xpcs: add Rockchip RK3568 platform glue driver Coia Prant
2026-09-14 19:44 ` sashiko-bot
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-15 11:21 ` Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 08/11] dt-bindings: net: rockchip-dwmac: document pcs-handle Coia Prant
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-13 18:58 ` [PATCH net-next v5 09/11] net: stmmac: dwmac-rk: add SGMII support for RK3568 Coia Prant
2026-09-14 19:44 ` sashiko-bot
2026-09-14 20:24 ` netdev-bot+sashiko
2026-09-15 11:42 ` Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 10/11] arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port Coia Prant
2026-09-13 18:58 ` [PATCH net-next v5 11/11] MAINTAINERS: add entry for Rockchip XPCS driver Coia Prant
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=20260914194421.944211F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=coiaprant@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/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