提交 16319a7d 编写于 作者: R Russell King 提交者: David S. Miller

net: phylink: ensure link is down when changing interface

The only PHYs that are used with phylink which change their interface
are the BCM84881 and MV88X3310 family, both of which only change their
interface modes on link-up events.  However, rather than relying upon
this behaviour by the PHY, we should give a stronger guarantee when
resolving that the link will be down whenever we change the interface
mode.  This patch implements that stronger guarantee for resolve.
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 319bfafe
......@@ -620,8 +620,18 @@ static void phylink_resolve(struct work_struct *w)
}
}
if (mac_config)
if (mac_config) {
if (link_state.interface != pl->link_config.interface) {
/* The interface has changed, force the link down and
* then reconfigure.
*/
if (cur_link_state) {
phylink_link_down(pl);
cur_link_state = false;
}
}
phylink_mac_config(pl, &link_state);
}
if (link_state.link != cur_link_state) {
pl->old_link_state = link_state.link;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册