From: Benedikt Spranger <b.spranger@linutronix.de>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Kurt Kanzenbach <kurt@linutronix.de>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>
Subject: [PATCH 1/1] net: dsa: b53: Disable all ports on setup
Date: Fri, 28 Jun 2019 18:58:11 +0200 [thread overview]
Message-ID: <20190628165811.30964-2-b.spranger@linutronix.de> (raw)
In-Reply-To: <20190628165811.30964-1-b.spranger@linutronix.de>
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>
---
drivers/net/dsa/b53/b53_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index a47f5bc667bd..5127c2fefba9 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -962,13 +962,13 @@ static int b53_setup(struct dsa_switch *ds)
if (ret)
dev_err(ds->dev, "failed to apply configuration\n");
- /* Configure IMP/CPU port, disable unused ports. Enabled
+ /* Configure IMP/CPU port, disable all other ports. Enabled
* ports will be configured with .port_enable
*/
for (port = 0; port < dev->num_ports; port++) {
if (dsa_is_cpu_port(ds, port))
b53_enable_cpu_port(dev, port);
- else if (dsa_is_unused_port(ds, port))
+ else
b53_disable_port(ds, port);
}
--
2.20.1
next prev parent reply other threads:[~2019-06-28 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 16:58 [PATCH 0/1] Disable all ports on b53 setup Benedikt Spranger
2019-06-28 16:58 ` Benedikt Spranger [this message]
2019-06-28 17:23 ` [PATCH 1/1] net: dsa: b53: Disable all ports on setup Florian Fainelli
2019-06-28 19:24 ` Vivien Didelot
2019-06-28 20:34 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190628165811.30964-2-b.spranger@linutronix.de \
--to=b.spranger@linutronix.de \
--cc=andrew@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=f.fainelli@gmail.com \
--cc=kurt@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox