summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorCoia Prant <coiaprant@gmail.com>2026-10-17 13:43:59 +0800
committerJakub Kicinski <kuba@kernel.org>2026-10-21 16:41:36 -0700
commite42329945d1613c2b41da9642b855f4612d8ea46 (patch)
treed07a52d7375f6f76e859a322c2d2e86c96314430 /scripts/Makefile.thinlto
parentde4aa72d6bb84d1ddb50669ffb7f62164fe49887 (diff)
downloadlinux-e42329945d1613c2b41da9642b855f4612d8ea46.tar.gz
linux-e42329945d1613c2b41da9642b855f4612d8ea46.zip
net: pcs: xpcs: add ANRESTART support for SGMII link recovery
On some hardware using the DesignWare XPCS IP (e.g., RK3568 MAC side SGMII), the PCS does not automatically restart auto-negotiation when the link goes down and comes back up. Without an explicit ANRESTART, the link stays down forever. Add BMCR_ANRESTART in two places: 1. In xpcs_config_aneg_c37_sgmii(), when starting AN, set ANRESTART alongside ANENABLE to initiate a fresh negotiation. 2. In xpcs_get_state_c37_sgmii(), when link is down and AN completion is detected, clear the interrupt and trigger ANRESTART to restart the negotiation process. Propagate the return value of the restart so errors are not silently ignored. The restart cannot go through the .pcs_an_restart op: phylink only calls it for 802.3z interfaces, and SGMII is not one. Changing hardware state from pcs_get_state() is already done elsewhere in this driver (xpcs_get_state_c73() calls xpcs_soft_reset() and xpcs_do_config()), so the same pattern is used here. The latch is cleared before issuing the restart, not after: clearing it afterwards would discard a freshly latched ANCMPLT from the new negotiation. If an MDIO access fails at this point, it indicates an unrecoverable hardware condition until reset. Also clear DW_VR_MII_AN_INTR_STS in xpcs_config_aneg_c37_sgmii() before starting AN, matching what xpcs_config_aneg_c37_1000basex() already does. On the non-inband path the function now returns the result of that write instead of the DIG_CTRL1 modify. Update the comment in xpcs_config_aneg_c37_sgmii() to note that although the DesignWare databook says AN restart is not needed for MAC side SGMII, some implementations (e.g. Rockchip RK3568) require it to recover the link after a disconnect. This is not a fix for an existing mainline platform: the affected platform (RK3568 XPCS) is introduced later in the same series. Tested-by: Jiawen Wu <jiawenwu@trustnetic.com> Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Signed-off-by: Coia Prant <coiaprant@gmail.com> Link: https://patch.msgid.link/20261017054406.1828061-2-coiaprant@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions