Bug 218187 - r8169: no carrier with RTL8125
Summary: r8169: no carrier with RTL8125
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: AMD Linux
: P3 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-24 22:22 UTC by Alex
Modified: 2023-12-04 16:30 UTC (History)
3 users (show)

See Also:
Kernel Version: v6.1.63
Subsystem:
Regression: Yes
Bisected commit-id: aa0a050c656981521f513fca0a45c8f74141e536


Attachments
dmesg output from kernel 6.1.13 with aa0a050c656981521f513fca0a45c8f74141e536 reverted (90.54 KB, text/plain)
2023-11-26 23:17 UTC, Alex
Details
dmesg output from kernel 6.1.13 without modifications (87.00 KB, text/plain)
2023-11-26 23:18 UTC, Alex
Details

Description Alex 2023-11-24 22:22:16 UTC
After updating from Linux kernel 6.1.62 to 6.1.63 the 2.5G RTL8125 Ethernet adapter on my MSI MAG X570 tomahawk motherboard stopped working reporting "NO CARRIER" from "ip a".  Nothing else appeared out of the ordinary.

I bisected the problem to commit aa0a050c656981521f513fca0a45c8f74141e536 (upstream commit 621735f590643e3048ca2060c285b80551660601).  I patched my kernel to revert commit aa0a050c656981521f513fca0a45c8f74141e536 and the network adapter works.

This is my first time reporting a bug to the Linux kernel, sorry if I missed anything important.  Please let me know if I can provide any additional information.
Comment 1 Heiner Kallweit 2023-11-25 21:56:09 UTC
Could you please test whether the following fixes the issue for you?

---
 drivers/net/ethernet/realtek/r8169_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index e32cc3279..28149714b 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3892,6 +3892,7 @@ static void rtl_reset_work(struct rtl8169_private *tp)
 
 	napi_enable(&tp->napi);
 	rtl_hw_start(tp);
+	rtl8169_init_phy(tp);
 }
 
 static void rtl8169_tx_timeout(struct net_device *dev, unsigned int txqueue)
@@ -4587,7 +4588,6 @@ static void rtl8169_up(struct rtl8169_private *tp)
 	pci_set_master(tp->pci_dev);
 	phy_init_hw(tp->phydev);
 	phy_resume(tp->phydev);
-	rtl8169_init_phy(tp);
 	napi_enable(&tp->napi);
 	set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
 	rtl_reset_work(tp);
-- 
2.43.0
Comment 2 Alex 2023-11-25 23:46:12 UTC
That patch sadly does not fix it.  The symptoms are the same with/without that patch applied to 6.1.63, no carrier.
Comment 3 Heiner Kallweit 2023-11-25 23:59:24 UTC
Can you please provide a full dmesg log?
Comment 4 Heiner Kallweit 2023-11-26 11:30:51 UTC
Also it would be good to know whether you're using a jumbo mtu. And if yes, whether issue persists if you use the standard mtu instead.
Comment 5 Alex 2023-11-26 23:17:22 UTC
Huh, good catch.  I am using a jumbo MTU, 9000.  With the standard MTU of 1500 it works.
Comment 6 Alex 2023-11-26 23:17:55 UTC
Created attachment 305480 [details]
dmesg output from kernel 6.1.13 with aa0a050c656981521f513fca0a45c8f74141e536 reverted
Comment 7 Alex 2023-11-26 23:18:19 UTC
Created attachment 305481 [details]
dmesg output from kernel 6.1.13 without modifications
Comment 8 Thomas Luzat 2023-11-27 10:11:35 UTC
It seems that I can confirm the same problem on 6.6.2 with a MSI MEG X570 UNIFY board (RTL8125A), 2.5G connection and jumbo frames. I did not bisect, but 6.6.1 still works.

With 6.6.2, the interface goes down and a number of tasks such as "ip a" hang. I got some backtrace involving rtnetlink when rebooting, but didn't yet capture it.
Comment 9 Heiner Kallweit 2023-11-27 13:43:35 UTC
It's not really PHY- or link-related, seems to be the same issue as described here, including the approach to fix it. Fix is on its way.

https://www.spinics.net/lists/netdev/msg952569.html
Comment 10 Heiner Kallweit 2023-12-04 13:03:39 UTC
Fixed with 59d395ed606d ("r8169: fix deadlock on RTL8125 in jumbo mtu mode").
It's included in 6.7-rc4 and queued for stable.
Comment 11 Alex 2023-12-04 16:30:18 UTC
Thank you for the debug and fix of this issue!

Note You need to log in before you can comment on or make changes to this bug.