]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl838x: set mode after patching
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 6 Jun 2026 19:17:32 +0000 (19:17 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Thu, 11 Jun 2026 18:27:30 +0000 (20:27 +0200)
In order to have a unified SerDes setup sequence, align RTL838x to all
other variants. Set the mode after patching has been applied. Testing on
devices showed the order is rather irrelevant.

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

index e6df4c1a2302a7f6c786707817d9b74ac80badff..b2ce5a124a72f1b7c0171777e6d63233ae6b406b 100644 (file)
@@ -939,15 +939,15 @@ static int rtpcs_838x_setup_serdes(struct rtpcs_serdes *sds,
        rtpcs_sds_write(sds, 0x0, 0x0, 0xc00);
        rtpcs_sds_write(sds, 0x0, 0x3, 0x7146);
 
+       rtpcs_838x_sds_patch(sds, hw_mode);
+       rtpcs_838x_sds_reset(sds);
+
        ret = rtpcs_838x_sds_set_mode(sds, hw_mode);
        if (ret)
                return ret;
 
        sds->hw_mode = hw_mode;
 
-       rtpcs_838x_sds_patch(sds, hw_mode);
-       rtpcs_838x_sds_reset(sds);
-
        /* release reset */
        rtpcs_sds_write(sds, 0, 3, 0x7106);