Skip to content

Commit

Permalink
net: dsa :mv88e6xxx: Disable unused ports
Browse files Browse the repository at this point in the history
If the NO_CPU strap is set, the switch starts in 'dumb hub' mode, with
all ports enable. Ports which are then actively used are reconfigured
as required when the driver starts. However unused ports are left
alone. Change this to disable them, and turn off any SERDES
interface. This could save some power and so reduce the temperature a
bit.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed May 4, 2019
1 parent 4a0eb73 commit 100a9b9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2599,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 100a9b9

Please sign in to comment.