]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl931x: set SerDes to off early 22786/head
authorJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 4 Feb 2026 22:02:00 +0000 (22:02 +0000)
committerRobert Marko <robimarko@gmail.com>
Sun, 5 Apr 2026 09:27:06 +0000 (11:27 +0200)
Set the SerDes mode to OFF early in the setup process to have a clear
starting point. This was part of the media handling before as a leftover
from the SDK code import. In the SDK, this function didn't only care
about applying some media settings but was also some kind of mode
setting for fiber modes.

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

index a676f4bf366ac5b093aa1124ffa9408d963f19d1..eac6d7154334574a5dc101698f7c468a23925b1c 100644 (file)
@@ -3519,8 +3519,6 @@ static int rtpcs_931x_sds_set_media(struct rtpcs_serdes *sds, enum rtpcs_sds_med
        rtpcs_sds_write_bits(sds, 0x2e, 0xf, 5, 0, 0x4);
 
        rtpcs_sds_write_bits(sds, 0x2a, 0x12, 7, 6, 0x1);
-       /* TODO: can we drop this in favor of turning off SerDes ealier? */
-       rtpcs_931x_sds_set_mode(sds, RTPCS_SDS_MODE_OFF);
 
        if (sds_media == RTPCS_SDS_MEDIA_NONE)
                return 0;
@@ -3724,6 +3722,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
        pr_info("%s: 2.5gbit %08X", __func__, rtpcs_sds_read(sds, 0x41, 0x14));
 
        rtpcs_931x_sds_power(sds, false);
+       rtpcs_931x_sds_set_mode(sds, RTPCS_SDS_MODE_OFF);
 
        ret = rtpcs_931x_sds_config_hw_mode(sds, hw_mode);
        if (ret < 0)