qualcommax: pcs-qca-uniphy: honour neg_mode for USXGMII autoneg

The USXGMII autoneg enable was keyed on the interface alone, so the XPCS
ran Clause 37 autonegotiation whenever the interface was USXGMII, no
matter what negotiation mode phylink had selected.

On an out-of-band link the PHY sends no code words, and the XPCS is left
waiting for them. The SerDes trains and the receiver reaches block lock,
but no traffic crosses the system interface in either direction, so the
port looks up while passing nothing.

Which side turns the PHY off depends on the kernel. From 6.16 the
Aquantia driver implements config_inband, and phylink calls it with
LINK_INBAND_DISABLE on a PHY managed link, which clears
MDIO_PHYXS_VEND_PROV2_USX_AN. On 6.12, the kernel this target builds by
default, that op does not exist and the PHY side is instead forced on
unconditionally by 0760-net-phy-aquantia-enable-USXGMII-MAC-autoneg.patch.

Key the write on neg_mode rather than dropping it, so a link that really
does negotiate in-band keeps working. Once the USXGMII ports are marked
in-band managed, this resolves to the value the driver already wrote, so
no in-tree board changes register state here today.

Diagnosed on the OpenWrt forum by rmandrad, who arrived at the same
condition independently and confirmed on a QNAP QHora-301w that enabling
autonegotiation on both the PHY and the XPCS makes the 10G ports pass
traffic.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24420
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Julius Bairaktaris 2026-07-26 11:45:11 +02:00 committed by Robert Marko
parent d6beac8814
commit be89f6298d

View file

@ -620,7 +620,9 @@ static int qca_uniphy_pcs_config_usxgmii(struct phylink_pcs *pcs,
return regmap_update_bits(uniphy->regmap, XPCS_MII_CTRL,
XPCS_MII_AN_EN,
interface == PHY_INTERFACE_MODE_USXGMII ? XPCS_MII_AN_EN : 0);
(interface == PHY_INTERFACE_MODE_USXGMII &&
neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) ?
XPCS_MII_AN_EN : 0);
}
static int qca_uniphy_pcs_config(struct phylink_pcs *pcs,