From 0f5015fc5ed5ef62a163a36570a1023e5e1167b8 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Wed, 4 Feb 2026 22:02:00 +0000 Subject: [PATCH] realtek: pcs: rtl931x: set SerDes to off early 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 Link: https://github.com/openwrt/openwrt/pull/22786 Signed-off-by: Robert Marko --- target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index a676f4bf36..eac6d71543 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -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)