From: Russell King Date: Tue, 21 Jul 2020 11:04:05 +0000 (+0100) Subject: net: phylink: update PCS when changing interface during resolution X-Git-Tag: v5.15~3197^2~173^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5005b163440f3fe18b434a20e8944dad508a15e8;p=platform%2Fkernel%2Flinux-starfive.git net: phylink: update PCS when changing interface during resolution 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. This will break when drivers are converted to split-PCS. Fix this. Reviewed-by: Florian Fainelli Signed-off-by: Russell King Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 1507ea8..f1693ec 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -629,8 +629,15 @@ static void phylink_resolve(struct work_struct *w) phylink_link_down(pl); cur_link_state = false; } + phylink_pcs_config(pl, false, &link_state); + pl->link_config.interface = link_state.interface; + } else { + /* The interface remains unchanged, only the speed, + * duplex or pause settings have changed. Call the + * old mac_config() method to configure the MAC/PCS. + */ + phylink_mac_config(pl, &link_state); } - phylink_mac_config(pl, &link_state); } if (link_state.link != cur_link_state) {