From 26dc5f0cad9ae641f967954eff80845591356333 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Wed, 20 May 2026 18:33:40 +0000 Subject: [PATCH] realtek: pcs: rtl931x: run set_mode before activate 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 --- 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 241acfbb90..4de3a2ed93 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 @@ -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; }