]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: phy: realtek: convert RTL8211F to .disable_autonomous_eee
authorNicolai Buchwitz <nb@tipi-net.de>
Mon, 6 Apr 2026 07:13:09 +0000 (09:13 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sun, 12 Apr 2026 18:33:23 +0000 (11:33 -0700)
The RTL8211F previously unconditionally disabled PHY-mode EEE in
config_init. Convert this to use the new .disable_autonomous_eee
callback so it is only disabled when the MAC indicates EEE support
via phy_support_eee().

This preserves PHY-autonomous EEE for MACs that do not support EEE,
while still disabling it when the MAC manages LPI.

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Link: https://patch.msgid.link/20260406-devel-autonomous-eee-v1-3-b335e7143711@tipi-net.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/realtek/realtek_main.c

index bdb1221023fb6b1f5f268fc533c2a31c8728695c..9c26531abe4a808414852f959730136842b51b85 100644 (file)
@@ -726,9 +726,8 @@ static int rtl8211f_config_aldps(struct phy_device *phydev)
        return phy_modify(phydev, RTL8211F_PHYCR1, mask, mask);
 }
 
-static int rtl8211f_config_phy_eee(struct phy_device *phydev)
+static int rtl8211f_disable_autonomous_eee(struct phy_device *phydev)
 {
-       /* Disable PHY-mode EEE so LPI is passed to the MAC */
        return phy_modify(phydev, RTL8211F_PHYCR2,
                          RTL8211F_PHYCR2_PHY_EEE_ENABLE, 0);
 }
@@ -866,7 +865,7 @@ static int rtl8211f_config_init(struct phy_device *phydev)
                return ret;
        }
 
-       return rtl8211f_config_phy_eee(phydev);
+       return 0;
 }
 
 static int rtl821x_suspend(struct phy_device *phydev)
@@ -2460,6 +2459,7 @@ static struct phy_driver realtek_drvs[] = {
                .led_hw_is_supported = rtl8211x_led_hw_is_supported,
                .led_hw_control_get = rtl8211f_led_hw_control_get,
                .led_hw_control_set = rtl8211f_led_hw_control_set,
+               .disable_autonomous_eee = rtl8211f_disable_autonomous_eee,
        }, {
                PHY_ID_MATCH_EXACT(RTL_8211FVD_PHYID),
                .name           = "RTL8211F-VD Gigabit Ethernet",
@@ -2476,6 +2476,7 @@ static struct phy_driver realtek_drvs[] = {
                .led_hw_is_supported = rtl8211x_led_hw_is_supported,
                .led_hw_control_get = rtl8211f_led_hw_control_get,
                .led_hw_control_set = rtl8211f_led_hw_control_set,
+               .disable_autonomous_eee = rtl8211f_disable_autonomous_eee,
        }, {
                .name           = "Generic FE-GE Realtek PHY",
                .match_phy_device = rtlgen_match_phy_device,