]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl931x: release IP mode force-lock for XSGMII
authorJonas Jelonek <jelonek.jonas@gmail.com>
Thu, 4 Jun 2026 22:32:07 +0000 (22:32 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 6 Jun 2026 07:54:58 +0000 (09:54 +0200)
rtpcs_931x_sds_deactivate() forces the SerDes IP mode register to OFF
(force-bit set, mode OFF) via apply_ip_mode(OFF). For IP-driven modes a
subsequent bring-up re-asserts the force-bit with the target mode, so the
lock is released. XSGMII, however, is MAC-driven: rtpcs_931x_sds_set_mode
only wrote the MAC mode and never released the IP force-lock, leaving the
IP block pinned OFF. XSGMII therefore only worked when the bootloader had
already configured the SerDes before deactivate ran.

Route the XSGMII branch through rtpcs_93xx_sds_set_mac_driven_mode(),
which unforces the IP mode (page 0x1f reg 0x09 bit 6) before writing the
MAC mode -- the same fix applied to RTL930x in 383c4469e4fd.

Link: https://github.com/openwrt/openwrt/pull/23674
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c

index 103387f26296d7869959a8e9c7b3b012a76902a5..2e80c1ba01950cad432e2fac62d7bb769f39a445 100644 (file)
@@ -3335,7 +3335,7 @@ static int rtpcs_931x_sds_set_mode(struct rtpcs_serdes *sds,
        int ret;
 
        if (hw_mode == RTPCS_SDS_MODE_XSGMII)
-               return rtpcs_93xx_sds_set_mac_mode(sds, hw_mode);
+               return rtpcs_93xx_sds_set_mac_driven_mode(sds, hw_mode);
 
        ret = rtpcs_931x_sds_apply_ip_mode(sds, hw_mode);
        if (ret)