]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Merge branch 'realtek-link-down'
authorDavid S. Miller <davem@davemloft.net>
Fri, 17 Jan 2025 12:01:41 +0000 (12:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jan 2025 12:01:41 +0000 (12:01 +0000)
commit5d6a361dc01d823cb7c10697f16695d45a82b909
tree61f7a7f88da3406e413d3ca219560caf7550ce76
parentce69b4019001407f9cd738dd2ba217b3a8ab831b
parentd3eb58549842c60ed46f37da7f4da969e3d6ecd3
Merge branch 'realtek-link-down'

Daniel Golle says:

====================
net: phy: realtek: fix status when link is down

The .read_status method for RealTek RTL822x PHYs (both C22 and C45) has
multilpe issues which result in reporting bogus link partner advertised
modes as well as speed and duplex while the link is down and no cable
is plugged in.

Example: ethtool after disconnecting a 1000M/Full capable link partner,
now with no wire plugged:

Settings for lan1:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
                            2500baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
                            2500baseT/Full
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  1000baseT/Full
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: No
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Auto-negotiation: on
    Port: Twisted Pair
    PHYAD: 7
    Transceiver: external
    MDI-X: Unknown
    Supports Wake-on: d
    Wake-on: d
    Link detected: no

Fix this by making sure all of the fields populated by
rtl822x_c45_read_status() or rtl822x_read_status() get reset, also in
case the link is down.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>