aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-08-01 16:32:37 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-01 20:09:10 -0700
commit7f5c6d7cdda7b67b11659cb5d2cfbaf5210d2fa8 (patch)
tree91c8ecfea0ecba6b9501db0a9db95172e7ba705f /drivers/net/dsa/mv88e6xxx
parentnet: dsa: bcm_sf2: remove unneeded supported flags (diff)
downloadlinux-dev-7f5c6d7cdda7b67b11659cb5d2cfbaf5210d2fa8.tar.xz
linux-dev-7f5c6d7cdda7b67b11659cb5d2cfbaf5210d2fa8.zip
net: dsa: mv88e6xxx: call phy_init_eee
It is safer to init the EEE before the DSA layer call phy_ethtool_set_eee, as sf2 and qca8k are doing. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx')
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 647d5d45c1d6..b531d4a3bab5 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -855,6 +855,12 @@ static int mv88e6xxx_set_eee(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv;
int err;
+ if (e->eee_enabled) {
+ err = phy_init_eee(phydev, 0);
+ if (err)
+ return err;
+ }
+
mutex_lock(&chip->reg_lock);
err = mv88e6xxx_energy_detect_write(chip, port, e);
mutex_unlock(&chip->reg_lock);