Commit 406cb0c4 authored by Russell King's avatar Russell King Committed by David S. Miller

net: phylink: ensure inband AN works correctly

Do not update the link interface mode while the link is down to avoid
spurious link interface changes.

Always call mac_config if we have a PHY to propagate the pause mode
settings to the MAC.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 94d250fa
...@@ -422,29 +422,22 @@ static void phylink_resolve(struct work_struct *w) ...@@ -422,29 +422,22 @@ static void phylink_resolve(struct work_struct *w)
case MLO_AN_INBAND: case MLO_AN_INBAND:
phylink_get_mac_state(pl, &link_state); phylink_get_mac_state(pl, &link_state);
if (pl->phydev) {
bool changed = false;
link_state.link = link_state.link && /* If we have a phy, the "up" state is the union of
pl->phy_state.link; * both the PHY and the MAC */
if (pl->phydev)
link_state.link &= pl->phy_state.link;
if (pl->phy_state.interface != /* Only update if the PHY link is up */
link_state.interface) { if (pl->phydev && pl->phy_state.link) {
link_state.interface = pl->phy_state.interface; link_state.interface = pl->phy_state.interface;
changed = true;
}
/* Propagate the flow control from the PHY /* If we have a PHY, we need to update with
* to the MAC. Also propagate the interface * the pause mode bits. */
* if changed.
*/
if (pl->phy_state.link || changed) {
link_state.pause |= pl->phy_state.pause; link_state.pause |= pl->phy_state.pause;
phylink_resolve_flow(pl, &link_state); phylink_resolve_flow(pl, &link_state);
phylink_mac_config(pl, &link_state); phylink_mac_config(pl, &link_state);
} }
}
break; break;
} }
} }
......
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