]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
r8169: set EEE speed down ratio to 1
authorChunHao Lin <hau@realtek.com>
Thu, 18 Sep 2025 02:34:25 +0000 (10:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:28 +0000 (15:37 -0500)
[ Upstream commit bf7154ffb1c65a201906296a9d3eb22e9daa5ffc ]

EEE speed down means speed down MAC MCU clock. It is not from spec.
It is kind of Realtek specific power saving feature. But enable it
may cause some issues, like packet drop or interrupt loss. Different
hardware may have different issues.

EEE speed down ratio (mac ocp 0xe056[7:4]) is used to set EEE speed
down rate. The larger this value is, the more power can save. But it
actually save less power then we expected. And, as mentioned above,
will impact compatibility. So set it to 1 (mac ocp 0xe056[7:4] = 0)
, which means not to speed down, to improve compatibility.

Signed-off-by: ChunHao Lin <hau@realtek.com>
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/20250918023425.3463-1-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/realtek/r8169_main.c

index 4b0ac73565ea97cb7c37c56772e6980ed6fa504c..bf79e2e9b7ecb45ea32d80435ee81c297c907f52 100644 (file)
@@ -3409,7 +3409,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
                r8168_mac_ocp_modify(tp, 0xd412, 0x0fff, sw_cnt_1ms_ini);
        }
 
-       r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0070);
+       r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
        r8168_mac_ocp_modify(tp, 0xe052, 0x6000, 0x8008);
        r8168_mac_ocp_modify(tp, 0xe0d6, 0x01ff, 0x017f);
        r8168_mac_ocp_modify(tp, 0xd420, 0x0fff, 0x047f);
@@ -3514,7 +3514,7 @@ static void rtl_hw_start_8117(struct rtl8169_private *tp)
                r8168_mac_ocp_modify(tp, 0xd412, 0x0fff, sw_cnt_1ms_ini);
        }
 
-       r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0070);
+       r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
        r8168_mac_ocp_write(tp, 0xea80, 0x0003);
        r8168_mac_ocp_modify(tp, 0xe052, 0x0000, 0x0009);
        r8168_mac_ocp_modify(tp, 0xd420, 0x0fff, 0x047f);
@@ -3715,7 +3715,7 @@ static void rtl_hw_start_8125_common(struct rtl8169_private *tp)
        r8168_mac_ocp_modify(tp, 0xc0b4, 0x0000, 0x000c);
        r8168_mac_ocp_modify(tp, 0xeb6a, 0x00ff, 0x0033);
        r8168_mac_ocp_modify(tp, 0xeb50, 0x03e0, 0x0040);
-       r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030);
+       r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
        r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
        r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001);
        if (tp->mac_version == RTL_GIGA_MAC_VER_70 ||