Skip to content

Commit

Permalink
Merge branch 'mv88e6xxx-Disable-ports-to-save-power'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed May 4, 2019
2 parents 2ce1aef + 100a9b9 commit 3b3600f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3b3600f

Please sign in to comment.