aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Spranger <b.spranger@linutronix.de>2019-06-28 12:58:11 -0400
committerDavid S. Miller <davem@davemloft.net>2019-06-28 16:34:13 -0400
commit75dad2520fc37345075498e9c5aa1355b4993dbc (patch)
tree93702853dcbf3bf37008224885712d5cb9c626a9
parente7792df831f5d6c183099a9dde224c9f4f763ebe (diff)
net: dsa: b53: Disable all ports on setup
A b53 device may configured through an external EEPROM like the switch device on the Lamobo R1 router board. The configuration of a port may therefore differ from the reset configuration of the switch. The switch configuration reported by the DSA subsystem is different until the port is configured by DSA i.e. a port can be active, while the DSA subsystem reports the port is inactive. Disable all ports and not only the unused ones to put all ports into a well defined state. Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/b53/b53_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index c8040ecf4425..907af62846ba 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -955,13 +955,13 @@ static int b53_setup(struct dsa_switch *ds)
955 if (ret) 955 if (ret)
956 dev_err(ds->dev, "failed to apply configuration\n"); 956 dev_err(ds->dev, "failed to apply configuration\n");
957 957
958 /* Configure IMP/CPU port, disable unused ports. Enabled 958 /* Configure IMP/CPU port, disable all other ports. Enabled
959 * ports will be configured with .port_enable 959 * ports will be configured with .port_enable
960 */ 960 */
961 for (port = 0; port < dev->num_ports; port++) { 961 for (port = 0; port < dev->num_ports; port++) {
962 if (dsa_is_cpu_port(ds, port)) 962 if (dsa_is_cpu_port(ds, port))
963 b53_enable_cpu_port(dev, port); 963 b53_enable_cpu_port(dev, port);
964 else if (dsa_is_unused_port(ds, port)) 964 else
965 b53_disable_port(ds, port); 965 b53_disable_port(ds, port);
966 } 966 }
967 967