]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl931x: run set_mode before activate
authorJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 20 May 2026 18:33:40 +0000 (18:33 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 26 May 2026 06:37:59 +0000 (08:37 +0200)
Move rtpcs_931x_sds_set_mode(sds, hw_mode) ahead of
rtpcs_931x_sds_activate() in rtpcs_931x_setup_serdes(). The IP-block
mode registers latch with the SerDes powered down, so the mode can be
committed during the configure phase rather than after power-on.

This matches the phase order already used by 838x and 930x
(deactivate -> configure -> set_mode -> activate) and is a step toward
a unified bring-up sequence across variants.

Verified on RTL931x hardware: USXGMII, SGMII and 10GBASE-R modes all
come up, link is established, L2 forwarding works, and iperf3 reports
expected throughput.

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

index 241acfbb909881e146a2e65dc63a944e7637a8a0..4de3a2ed935efd79825015d4809049733ead21bc 100644 (file)
@@ -3868,14 +3868,13 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
                return ret;
        }
 
-       rtpcs_931x_sds_activate(sds);
-
        ret = rtpcs_931x_sds_set_mode(sds, hw_mode);
        if (ret < 0)
                return ret;
 
        sds->hw_mode = hw_mode;
 
+       rtpcs_931x_sds_activate(sds);
        return 0;
 }