]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl930x: fix symbol error read
authorJonas Jelonek <jelonek.jonas@gmail.com>
Thu, 5 Mar 2026 21:59:55 +0000 (21:59 +0000)
committerRobert Marko <robimarko@gmail.com>
Sat, 21 Mar 2026 22:06:10 +0000 (23:06 +0100)
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 <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22450
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c

index 2f66d3c4728def7a79c042e508a80663ad674ed9..151cc650bf68a0298b4b4560af724c630bb81fe0 100644 (file)
@@ -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;