RE: [PATCH net v3] r8152: Use BMSR to detect the link state

From: Hayes Wang

Date: Tue Oct 27 2026 - 01:50:44 EST


Linmao Li <lilinmao@xxxxxxxxxx>
> Sent: Monday, October 26, 2026 9:24 AM
> To: andrew+netdev@xxxxxxx; davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx;
> kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx
> Cc: Hayes Wang <hayeswang@xxxxxxxxxxx>; nic_swsd
> <nic_swsd@xxxxxxxxxxx>; Chih Kai Hsu <hsu.chih.kai@xxxxxxxxxxx>;
> mail@xxxxxxxxxxxxxxxxx; zhangxiangqian@xxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; stable@xxxxxxxxxxxxxxx;
> Linmao Li <lilinmao@xxxxxxxxxx>
> Subject: [PATCH net v3] r8152: Use BMSR to detect the link state
>
>
> External mail : This email originated from outside the organization. Do not
> reply, click links, or open attachments unless you recognize the sender and
> know the content is safe.
>
>
>
> r8152 detects carrier from PLA_PHYSTATUS without reading BMSR, so
> BMSR_LSTATUS can remain latched low after link up. Since
> commit f6f2e946aa4d ("net: mii: Fix the Speed display when the network
> cable is not connected"), the first speed query can then report
> SPEED_UNKNOWN, which applications such as NetworkManager may cache
> until the next carrier change.
>
> Use BMSR_LSTATUS in set_carrier() so a latched link down can turn
> carrier off after the link has recovered. If BMSR reports down but
> PLA_PHYSTATUS reports up, reschedule the link work to read the current
> state without waiting for another notification.
>
> Tested on an RTL8153B: NetworkManager reported 1000 Mb/s after 3 of 3
> rebinds, instead of an unknown speed.
>
> Fixes: f6f2e946aa4d ("net: mii: Fix the Speed display when the network cable is
> not connected")
> Cc: stable@xxxxxxxxxxxxxxx
> Suggested-by: Hayes Wang <hayeswang@xxxxxxxxxxx>
> Signed-off-by: Linmao Li <lilinmao@xxxxxxxxxx>

Reviewed-by: Hayes Wang <hayeswang@xxxxxxxxxxx>

Best Regards,
Hayes