Re: [PATCH net v2] r8152: Use BMSR to detect the link state

From: Linmao Li

Date: Mon Oct 12 2026 - 22:52:38 EST



在 2026/10/13 0:13, Birger Koblitz 写道:
Hi Linmao,

On 09/10/2026 9:18 am, Linmao Li wrote:

Hi Birger,

Thanks for testing. Only the first BMSR read after link up returns the
latched value, so ethtool shows the problem only if nothing else reads
the PHY first. On my systems NetworkManager reads it right after
carrier up, so a later ethtool reports 1000Mb/s while NetworkManager
keeps the unknown speed it read.

With an RTL8153B on v7.3-rc6, stopping NetworkManager was enough for
ethtool alone to show it after 3 of 3 USB rebinds:

   # systemctl stop NetworkManager
   # (rebind the device, bring the interface up, wait for carrier)
   # ethtool <iface> | grep Speed
           Speed: Unknown!
   # ethtool <iface> | grep Speed
           Speed: 1000Mb/s

I got the same result with cable replugs on a 6.6-based kernel. The
latch does not time out: the first ethtool still reported Unknown 3 s
after carrier up. On the 6.6-based system, the network service of a
Chromium-based browser also read the PHY first, so other tools may
need to be stopped too. I have not checked your setup and have not
tested an RTL8153A.

Thanks for the explanation. I re-did the test and confirm that the fix works. I tested on:

RTL8157 (5GBit device, 2.5GBit link)
driver: r8152
version: 7.1.8+deb13-amd64
firmware-version: rtl8157-1 v1 2026/01/01

RTL8153A (1GBit device, 1GBit link)
driver: r8152
version: 7.1.8+deb13-amd64
firmware-version: rtl8153a-4 v2 02/07/20

both worked flawlessly. I tested
- plug/unplug during normal operation
- link-changes by peer in normal operation
- plug or unplug during suspend, then resume

Tested-by: Birger Koblitz <mail@xxxxxxxxxxxxxxxxx>

Birger
Hi Birger,

Thanks a lot for testing both devices. Just to be sure, was it the v2
patch as posted, without other changes? The RTL8157 result is
interesting given Hayes's comment about the newer ICs.

The next version will probably change the approach, so I will only
keep your Tested-by if the code stays the same, and would be glad if
you could test it again.

Thanks,
Linmao