Commit f4d3e61b authored by David S. Miller's avatar David S. Miller

Merge branch 'net-phy-xpcs-Improvements-for-next'

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: default avatarDavid S. Miller <davem@davemloft.net>
parents c31f0ea7 1874b83a
......@@ -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;
}
......@@ -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;
}
......@@ -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);
}
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment