Skip to content

Commit

Permalink
Merge branch 'net-phy-xpcs-Improvements-for-next'
Browse files Browse the repository at this point in the history
Jose Abreu says:

====================
net: phy: xpcs: Improvements for -next

Misc set of improvements for XPCS. All for net-next.

Patch 1/4, returns link error upon 10GKR faults are detected.

Patch 2/4, resets XPCS upon probe so that we start from well known state.

Patch 3/4, sets Link as down if AutoNeg is enabled but did not finish with
success.

Patch 4/4, restarts AutoNeg process if previous outcome was not valid.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 24, 2020
2 parents c31f0ea + 1874b83 commit f4d3e61
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/net/phy/mdio-xpcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ static int xpcs_read_fault(struct mdio_xpcs_args *xpcs,
if (ret < 0)
return ret;

if (ret & MDIO_PCS_10GBRT_STAT2_ERR)
if (ret & MDIO_PCS_10GBRT_STAT2_ERR) {
xpcs_warn(xpcs, state, "Link has errors!\n");
return -EFAULT;
}

return 0;
}
Expand Down Expand Up @@ -431,8 +433,10 @@ static int xpcs_aneg_done(struct mdio_xpcs_args *xpcs,
return ret;

/* Check if Aneg outcome is valid */
if (!(ret & DW_C73_AN_ADV_SF))
if (!(ret & DW_C73_AN_ADV_SF)) {
xpcs_config_aneg(xpcs);
return 0;
}

return 1;
}
Expand Down Expand Up @@ -615,10 +619,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);
}
Expand Down Expand Up @@ -686,7 +692,7 @@ static int xpcs_probe(struct mdio_xpcs_args *xpcs, phy_interface_t interface)
match = entry;

if (xpcs_check_features(xpcs, match, interface))
return 0;
return xpcs_soft_reset(xpcs, MDIO_MMD_PCS);
}
}

Expand Down

0 comments on commit f4d3e61

Please sign in to comment.