diff options
author | David S. Miller <davem@davemloft.net> | 2019-05-03 23:53:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-03 23:53:06 -0400 |
commit | 3b3600fffb437ff5b6331e7dffb98408747b7c12 (patch) | |
tree | bef41277851ad85fba3d13e498d2cb3ea00cb646 /drivers/net/dsa/mv88e6xxx | |
parent | Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue (diff) | |
parent | net: dsa :mv88e6xxx: Disable unused ports (diff) | |
download | linux-dev-3b3600fffb437ff5b6331e7dffb98408747b7c12.tar.xz linux-dev-3b3600fffb437ff5b6331e7dffb98408747b7c12.zip |
Merge branch 'mv88e6xxx-Disable-ports-to-save-power'
Andrew Lunn says:
====================
mv88e6xxx: Disable ports to save power
Save some power by disabling ports. The first patch fully disables a
port when it is runtime disabled. The second disables any ports which
are not used at all.
Depending on configuration strapping, this can lower the temperature
of an idle switch a few degrees.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 489a899c80b6..46020fe1b5e7 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2428,6 +2428,9 @@ static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port) mutex_lock(&chip->reg_lock); + if (mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED)) + dev_err(chip->dev, "failed to disable port\n"); + if (chip->info->ops->serdes_irq_free) chip->info->ops->serdes_irq_free(chip, port); @@ -2596,8 +2599,18 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) /* Setup Switch Port Registers */ for (i = 0; i < mv88e6xxx_num_ports(chip); i++) { - if (dsa_is_unused_port(ds, i)) + if (dsa_is_unused_port(ds, i)) { + err = mv88e6xxx_port_set_state(chip, i, + BR_STATE_DISABLED); + if (err) + goto unlock; + + err = mv88e6xxx_serdes_power(chip, i, false); + if (err) + goto unlock; + continue; + } err = mv88e6xxx_setup_port(chip, i); if (err) |