From 02f1d73192a9ddc29f635dbbc1b4b95d0e57b922 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 16 Mar 2026 15:22:55 +0000 Subject: [PATCH] realtek: pcs: rtl930x: fix calibration check Comparing our calibration check with the one in the SDK ([1]), one can see some discrepancies for which there are no apparent reasons. SGMII and 1000Base-X are handled equal to XSGMII although they aren't in the SDK and have different symbol error registers. USXGMII and 10GBase-R are fine, but other modes are explicitly handled with failure then. Restructure this by keeping XSGMII alone with its dedicated check (as the SDK does) and handle all other modes differently. Though the SDK just skips symbol error check for modes like SGMII, 1000Base-X, 2500Base-X, it was found to be ok to perform a simple check for them too. Since we have also a default case in the symbol error read implementation now, we can cover all other modes with default case here too. As a side-effect, this removes the confusing and probably wrong failure stating calibration has failed although just the checks were insufficient. Signed-off-by: Jonas Jelonek Link: https://github.com/openwrt/openwrt/pull/22450 Signed-off-by: Robert Marko --- .../realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c index 98a09eaa1c..ee0d685a6c 100644 --- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c @@ -2610,8 +2610,6 @@ static int rtpcs_930x_sds_check_calibration(struct rtpcs_serdes *sds, errors2 = rtpcs_930x_sds_sym_err_get(sds, hw_mode); switch (hw_mode) { - case RTPCS_SDS_MODE_1000BASEX: - case RTPCS_SDS_MODE_SGMII: case RTPCS_SDS_MODE_XSGMII: if ((errors2 - errors1 > 100) || (errors1 >= 0xffff00) || (errors2 >= 0xffff00)) { @@ -2619,16 +2617,12 @@ static int rtpcs_930x_sds_check_calibration(struct rtpcs_serdes *sds, return 1; } break; - case RTPCS_SDS_MODE_10GBASER: - case RTPCS_SDS_MODE_USXGMII_10GSXGMII: - case RTPCS_SDS_MODE_USXGMII_10GQXGMII: + default: if (errors2 > 0) { - pr_info("%s: 10G error rate too high\n", __func__); + pr_info("%s: symbol error rate too high\n", __func__); return 1; } break; - default: - return 1; } return 0;