* [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power
@ 2019-04-30 22:08 Andrew Lunn
2019-04-30 22:08 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable Andrew Lunn
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Andrew Lunn @ 2019-04-30 22:08 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Vivien Didelot, Andrew Lunn
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.
Andrew Lunn (2):
net: dsa: mv88e6xxx: Set STP disable state in port_disable
net: dsa :mv88e6xxx: Disable unused ports
drivers/net/dsa/mv88e6xxx/chip.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--
2.20.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable
2019-04-30 22:08 [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power Andrew Lunn
@ 2019-04-30 22:08 ` Andrew Lunn
2019-05-03 14:18 ` Vivien Didelot
2019-05-03 17:27 ` Florian Fainelli
2019-04-30 22:08 ` [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports Andrew Lunn
2019-05-04 3:54 ` [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power David Miller
2 siblings, 2 replies; 8+ messages in thread
From: Andrew Lunn @ 2019-04-30 22:08 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Vivien Didelot, Andrew Lunn
When requested to disable a port, set the port STP state to disabled.
This fully disables the port and should save some power.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 489a899c80b6..dc891d83610e 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);
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports
2019-04-30 22:08 [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power Andrew Lunn
2019-04-30 22:08 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable Andrew Lunn
@ 2019-04-30 22:08 ` Andrew Lunn
2019-05-03 14:18 ` Vivien Didelot
2019-05-03 17:27 ` Florian Fainelli
2019-05-04 3:54 ` [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power David Miller
2 siblings, 2 replies; 8+ messages in thread
From: Andrew Lunn @ 2019-04-30 22:08 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Vivien Didelot, Andrew Lunn
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>
---
drivers/net/dsa/mv88e6xxx/chip.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index dc891d83610e..46020fe1b5e7 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -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)
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable
2019-04-30 22:08 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable Andrew Lunn
@ 2019-05-03 14:18 ` Vivien Didelot
2019-05-03 17:27 ` Florian Fainelli
1 sibling, 0 replies; 8+ messages in thread
From: Vivien Didelot @ 2019-05-03 14:18 UTC (permalink / raw)
To: Andrew Lunn; +Cc: David Miller, netdev, Andrew Lunn
On Wed, 1 May 2019 00:08:30 +0200, Andrew Lunn <andrew@lunn.ch> wrote:
> When requested to disable a port, set the port STP state to disabled.
> This fully disables the port and should save some power.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports
2019-04-30 22:08 ` [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports Andrew Lunn
@ 2019-05-03 14:18 ` Vivien Didelot
2019-05-03 17:27 ` Florian Fainelli
1 sibling, 0 replies; 8+ messages in thread
From: Vivien Didelot @ 2019-05-03 14:18 UTC (permalink / raw)
To: Andrew Lunn; +Cc: David Miller, netdev, Andrew Lunn
On Wed, 1 May 2019 00:08:31 +0200, Andrew Lunn <andrew@lunn.ch> wrote:
> 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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable
2019-04-30 22:08 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable Andrew Lunn
2019-05-03 14:18 ` Vivien Didelot
@ 2019-05-03 17:27 ` Florian Fainelli
1 sibling, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2019-05-03 17:27 UTC (permalink / raw)
To: Andrew Lunn, David Miller; +Cc: netdev, Vivien Didelot
On 4/30/19 3:08 PM, Andrew Lunn wrote:
> When requested to disable a port, set the port STP state to disabled.
> This fully disables the port and should save some power.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports
2019-04-30 22:08 ` [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports Andrew Lunn
2019-05-03 14:18 ` Vivien Didelot
@ 2019-05-03 17:27 ` Florian Fainelli
1 sibling, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2019-05-03 17:27 UTC (permalink / raw)
To: Andrew Lunn, David Miller; +Cc: netdev, Vivien Didelot
On 4/30/19 3:08 PM, Andrew Lunn wrote:
> 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: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power
2019-04-30 22:08 [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power Andrew Lunn
2019-04-30 22:08 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable Andrew Lunn
2019-04-30 22:08 ` [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports Andrew Lunn
@ 2019-05-04 3:54 ` David Miller
2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2019-05-04 3:54 UTC (permalink / raw)
To: andrew; +Cc: netdev, vivien.didelot
From: Andrew Lunn <andrew@lunn.ch>
Date: Wed, 1 May 2019 00:08:29 +0200
> 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.
Series applied, thanks Andrew.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-05-04 3:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-30 22:08 [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power Andrew Lunn
2019-04-30 22:08 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable Andrew Lunn
2019-05-03 14:18 ` Vivien Didelot
2019-05-03 17:27 ` Florian Fainelli
2019-04-30 22:08 ` [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports Andrew Lunn
2019-05-03 14:18 ` Vivien Didelot
2019-05-03 17:27 ` Florian Fainelli
2019-05-04 3:54 ` [PATCH net-next 0/2] mv88e6xxx: Disable ports to save power David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).