From e198b2504c2bd0cb05b7a36083b54d08d2239afc Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Thu, 5 Mar 2026 21:59:55 +0000 Subject: [PATCH] realtek: pcs: rtl930x: fix symbol error read Fix the symbol error read implementation to be usable for other modes too. While we handle other modes as 'not supported', the SDK has a generic read used in the 'default' case. Do the same so we can have proper 2500Base-X support here and avoid confusing error messages. Signed-off-by: Jonas Jelonek Link: https://github.com/openwrt/openwrt/pull/22450 Signed-off-by: Robert Marko --- .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 2f66d3c472..151cc650bf 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 @@ -2571,8 +2571,8 @@ static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_serdes *sds, switch (hw_mode) { case RTPCS_SDS_MODE_QSGMII: case RTPCS_SDS_MODE_XSGMII: - v = rtpcs_sds_read_bits(sds, 0x1, 0x1, 15, 8) << 16; - v |= rtpcs_sds_read_bits(sds, 0x1, 0x0, 15, 0); + v = rtpcs_sds_read_bits(sds, 0x1, 0x1, 15, 8) << 16; /* ALL_SYMBOLERR_CNT_NEW_23_16 */ + v |= rtpcs_sds_read_bits(sds, 0x1, 0x0, 15, 0); /* ALL_SYMBOLERR_CNT_NEW_15_0 */ break; case RTPCS_SDS_MODE_USXGMII_10GQXGMII: @@ -2583,10 +2583,14 @@ static u32 rtpcs_930x_sds_sym_err_get(struct rtpcs_serdes *sds, case RTPCS_SDS_MODE_10GBASER: case RTPCS_SDS_MODE_USXGMII_10GSXGMII: v = rtpcs_sds_read(sds, 0x5, 0x1); - return v & 0xff; + v &= 0xff; + break; default: - pr_info("%s unsupported PHY-mode\n", __func__); + rtpcs_sds_write_bits(sds, 0x1, 24, 2, 0, 0); + + v = rtpcs_sds_read_bits(sds, 0x1, 0x3, 15, 8) << 16; /* MUX_SYMBOLERR_CNT_NEW_23_16 */ + v |= rtpcs_sds_read_bits(sds, 0x1, 0x2, 15, 0); /* MUX_SYMBOLERR_CNT_NEW_15_0 */ } return v;