net: phy: xpcs: Set Link down if AutoNeg is enabled and did not finish

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>
This commit is contained in:
Jose Abreu 2020-03-20 10:53:36 +01:00 committed by David S. Miller
parent aaf99e8d56
commit e1eab7dfa6
1 changed files with 3 additions and 1 deletions

View 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);
}