]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: phy: xpcs: Set Link down if AutoNeg is enabled and did not finish
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 20 Mar 2020 09:53:36 +0000 (10:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 04:01:58 +0000 (21:01 -0700)
Set XPCS Link as down when AutoNeg is enabled but it didn't finish with
success.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio-xpcs.c

index 54976047dcb997145ff642e91937866739696a09..f10d86b85fbda8a703ba4265ebd89540a6b9bc71 100644 (file)
@@ -617,10 +617,12 @@ static int xpcs_get_state(struct mdio_xpcs_args *xpcs,
                return xpcs_config(xpcs, state);
        }
 
-       if (state->link && state->an_enabled && xpcs_aneg_done(xpcs, state)) {
+       if (state->an_enabled && xpcs_aneg_done(xpcs, state)) {
                state->an_complete = true;
                xpcs_read_lpa(xpcs, state);
                xpcs_resolve_lpa(xpcs, state);
+       } else if (state->an_enabled) {
+               state->link = 0;
        } else if (state->link) {
                xpcs_resolve_pma(xpcs, state);
        }