]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
net: dsa: bcm_sf2: Ensure we re-negotiate EEE during after link change
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 22 Nov 2016 19:40:58 +0000 (11:40 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Nov 2016 20:53:50 +0000 (15:53 -0500)
In case the link change and EEE is enabled or disabled, always try to
re-negotiate this with the link partner.

Fixes: 450b05c15f9c ("net: dsa: bcm_sf2: add support for controlling EEE")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2.c

index e3ee27ce13dd370906ccbfe910a6c0a2e56a2956..9ec33b51a0edad879701bef79d6c8f250d778b91 100644 (file)
@@ -588,6 +588,7 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
                                   struct phy_device *phydev)
 {
        struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
+       struct ethtool_eee *p = &priv->port_sts[port].eee;
        u32 id_mode_dis = 0, port_mode;
        const char *str = NULL;
        u32 reg;
@@ -662,6 +663,9 @@ force_link:
                reg |= DUPLX_MODE;
 
        core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(port));
+
+       if (!phydev->is_pseudo_fixed_link)
+               p->eee_enabled = bcm_sf2_eee_init(ds, port, phydev);
 }
 
 static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port,