From 017bf1c37e6913857ca33ba79b408ef296f4cb39 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 24 Apr 2026 08:50:21 +0200 Subject: [PATCH] kernel: rtl8261n: drop unreachable PHY register patch The PHY register patch in question is gated by `CONFIG_MACH_REALTEK_RTL`, has no documented/expected behavior, and is in practice unreachable: `phy_patch()` is only called from `rtkphy_config_init()`, which is exits (too) early for `CONFIG_MACH_REALTEK_RTL` builds. Remove it as a cleanup step before enabling standard USXGMII configuration for these PHYs. Fixes: b77fa45d1278 ("kernel: fix rtl8261n driver for realtek") Co-authored-by: Jonas Jelonek Signed-off-by: Sven Eckelmann Link: https://github.com/openwrt/openwrt/pull/23076 Signed-off-by: Hauke Mehrtens --- .../files/drivers/net/phy/rtl8261n/phy_patch.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/rtl8261n/phy_patch.c b/target/linux/generic/files/drivers/net/phy/rtl8261n/phy_patch.c index 3614dc2833..4d2cefe6a7 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8261n/phy_patch.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8261n/phy_patch.c @@ -98,11 +98,6 @@ static int32 _phy_patch_process(uint32 unit, rtk_port_t port, uint8 portOffset, return (chk_ret == RT_ERR_CHECK_FAILED) ? chk_ret : RT_ERR_OK; } -rtk_hwpatch_t rtl826XB_patch_rtk_conf[] = { - {RTK_PATCH_OP_PSDS0 , 0xff , 0x07 , 0x10 , 15, 0, 0x80aa, RTK_PATCH_CMP_WC , 0, 0, 0, 0}, - {RTK_PATCH_OP_PSDS0 , 0xff , 0x06 , 0x12 , 15, 0, 0x5078, RTK_PATCH_CMP_WC , 0, 0, 0, 0}, -}; - /* Function Name: * phy_patch * Description: @@ -175,16 +170,6 @@ int32 phy_patch(uint32 unit, rtk_port_t port, uint8 portOffset, uint8 patch_mode break; } } -#ifdef CONFIG_MACH_REALTEK_RTL - ret = _phy_patch_process(unit, port, portOffset, rtl826XB_patch_rtk_conf, sizeof(rtl826XB_patch_rtk_conf), patch_mode); - if (ret == RT_ERR_CHECK_FAILED) - chk_ret = ret; - else if (ret != RT_ERR_OK) - { - RT_LOG(LOG_MAJOR_ERR, (MOD_HAL | MOD_PHY), "U%u P%u patch_mode:%u id:%u patch-%u failed. ret:0x%X\n", unit, port, patch_mode, i, patch_type, ret); - return ret; - } -#endif return (chk_ret == RT_ERR_CHECK_FAILED) ? chk_ret : RT_ERR_OK; }