From: Jonas Jelonek Date: Thu, 11 Jun 2026 20:05:28 +0000 (+0000) Subject: realtek: pcs: rtl930x: apply tx config before activation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d60ef16ada97c4ec0fa01d35a0ef6f26854f4a1;p=thirdparty%2Fopenwrt.git realtek: pcs: rtl930x: apply tx config before activation In RTL930x setup, tx config was called at then end of the procedure after configuration and calibration ran. This is still a leftover from the old code located in DSA/PHY. However, applying TX configuration like amplification factors, etc. doesn't make sense after calibration, it should run before. Moreover the call was commented with "leave loopback mode" which is just wrong and doesn't describe what the function does. Fix this misery. Testing on device with different interface modes shows no difference so far, especially no negative effects. Link: https://github.com/openwrt/openwrt/pull/23759 Signed-off-by: Jonas Jelonek --- 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 aa49a85a5e2..a24be40c4ff 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 @@ -3070,6 +3070,8 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds, */ rtpcs_sds_write_bits(sds, 0x1f, 11, 1, 1, 1); + rtpcs_930x_sds_tx_config(sds, hw_mode); + /* Enable SDS in desired mode */ ret = rtpcs_930x_sds_set_mode(sds, hw_mode); if (ret < 0) @@ -3080,7 +3082,7 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds, rtpcs_930x_sds_activate(sds); if (hw_mode == RTPCS_SDS_MODE_QSGMII) - goto skip_cali; + return 0; /* Calibrate SerDes receiver in loopback mode */ rtpcs_930x_sds_10g_idle(sds); @@ -3092,10 +3094,6 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds, if (calib_tries >= 3) pr_warn("%s: SerDes RX calibration failed\n", __func__); -skip_cali: - /* Leave loopback mode */ - rtpcs_930x_sds_tx_config(sds, hw_mode); - return 0; }