From: Nicolai Buchwitz Date: Mon, 6 Apr 2026 07:13:09 +0000 (+0200) Subject: net: phy: realtek: convert RTL8211F to .disable_autonomous_eee X-Git-Tag: v7.1-rc1~173^2~27^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=bb14e3b63c63a48307843c82180bc8abb34e1acc;p=thirdparty%2Flinux.git net: phy: realtek: convert RTL8211F to .disable_autonomous_eee 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 Link: https://patch.msgid.link/20260406-devel-autonomous-eee-v1-3-b335e7143711@tipi-net.de Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c index bdb1221023fb6..9c26531abe4a8 100644 --- a/drivers/net/phy/realtek/realtek_main.c +++ b/drivers/net/phy/realtek/realtek_main.c @@ -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,