Skip to contentSkip to conversation

r8169: clear TX LPI on RTL8168h at link up after phylink conversion

PATCH Applied Sasha Levin 2 participants 2 messages Oct 20 – Oct 22

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 r8169: clear TX LPI on RTL8168h at link up after phylink conversion

Commit 3cdeaef1754a ("r8169: disable EEE on RTL8168h/8111h") disables EEE on RTL_GIGA_MAC_VER_46 with phy_disable_eee() but keeps the version EEE-capable, so that link up still calls rtl_enable_tx_lpi(tp, false) and clears the MAC TX-LPI bits (ERI 0x1b0[1:0]). rtl_hw_start_8168h_1() does not clear them, so a warm reboot from an EEE-active state could otherwise leave TX-LPI asserted while the PHY no longer negotiates EEE.

In net-next, commit 8a3c76523e44 ("r8169: add support for phylink") moved link handling to phylink, and rtl_mac_link_up() does not touch the TX-LPI bits. The merge of net into net-next kept the phy_disable_eee() quirk and its comment, but not the link-up clear it depends on. The only remaining clear is rtl_mac_disable_tx_lpi(), which phylink calls from phylink_deactivate_lpi() only after phylink_activate_lpi() has enabled LPI. With EEE disabled on this chip that never happens, so the bits are never cleared and the comment in r8169_mdio_register() no longer holds.

Clear TX-LPI explicitly in rtl_mac_link_up() for RTL_GIGA_MAC_VER_46.

Fixes f49defea7668 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")

---
llminus, an LLM-assisted merge conflict resolution tool, found this while resolving the same net/net-next conflict in our integration tree. Not tested on RTL8168h hardware, and the warm reboot case was not reproduced.

Javen's proposal in the linked thread, returning no LPI capabilities for this version, has the same gap: phylink then calls neither LPI op.

 drivers/net/ethernet/realtek/r8169_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/realtek/r8169_main.c +2 -0
index 88354e7570f00..cd4ebc654dd0b 100644
@@ -6428,6 +6428,8 @@ static void rtl_mac_link_up(struct phylink_config *config,
 
 	tp->speed = speed;
 	rtl_link_chg_patch(tp, speed);
+	if (tp->mac_version == RTL_GIGA_MAC_VER_46)
+		rtl_enable_tx_lpi(tp, false);
 
 	/*
 	 * Note: This hardware does not support forcing flow control.
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 20 Oct 2026 12:15:42 -0400 you wrote:

Commit 3cdeaef1754a ("r8169: disable EEE on RTL8168h/8111h") disables EEE on RTL_GIGA_MAC_VER_46 with phy_disable_eee() but keeps the version EEE-capable, so that link up still calls rtl_enable_tx_lpi(tp, false) and clears the MAC TX-LPI bits (ERI 0x1b0[1:0]). rtl_hw_start_8168h_1() does not clear them, so a warm reboot from an EEE-active state could otherwise leave TX-LPI asserted while the PHY no longer negotiates EEE.

[...]

Here is the summary with links:
- [net-next] r8169: clear TX LPI on RTL8168h at link up after phylink conversion

    https://git.kernel.org/netdev/net-next/c/f71ff7d40652

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html