]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
kernel: rtl8261n: drop unreachable PHY register patch
authorSven Eckelmann <sven@narfation.org>
Fri, 24 Apr 2026 06:50:21 +0000 (08:50 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 25 Apr 2026 17:56:08 +0000 (19:56 +0200)
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 <jelonek.jonas@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/23076
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/generic/files/drivers/net/phy/rtl8261n/phy_patch.c

index 3614dc2833547028d7969ac57955889277de6dca..4d2cefe6a7f361990b6b0443a8ba5bd3f7595138 100644 (file)
@@ -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;
 }