RE: [PATCH net v2] r8152: Use BMSR to detect the link state
From: Hayes Wang
Date: Tue Oct 13 2026 - 03:39:07 EST
Linmao Li <lilinmao@xxxxxxxxxx>
> Sent: Friday, October 9, 2026 3:16 PM
[...]
> Hi Hayes, Andrew,
>
> Thanks. Since the newer ICs notify only when the link status changes, the driver
> cannot rely on another link up notification after the link has settled, so v2 can
> leave the carrier off when the first read returns the latched link down.
>
> Before sending v3, which approach would you prefer? Both fixed the problem
> in my tests on an RTL8153B with v7.3-rc6:
>
> a) Keep carrier detection on PLA_PHYSTATUS and read BMSR once before
> carrier on, only to clear the latch. This is the option I asked
> about on v1.
I prefer option a). Using PLA_PHYSTATUS for carrier detection is the approach
recommended by our hardware engineers, and we have tested and verified it.
> b) Detect carrier from BMSR and read it again when the first read
> returns link down, as genphy_update_link() does in interrupt mode.
>
> Neither depends on another notification. Neither reports a short link drop that
> recovers before the link work runs: with a) a later speed query still sees the
> latched link down, with b) the latch is cleared.
>
> Hayes, for b): is BMSR_LSTATUS reliable as the carrier source on all chips
> supported by r8152?
I’m not familiar with this part, so I need to confirm it with our PHY engineers.
Best Regards,
Hayes