* [PATCH 0/1] Disable all ports on b53 setup
@ 2019-06-28 16:58 Benedikt Spranger
2019-06-28 16:58 ` [PATCH 1/1] net: dsa: b53: Disable all ports on setup Benedikt Spranger
0 siblings, 1 reply; 5+ messages in thread
From: Benedikt Spranger @ 2019-06-28 16:58 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, Sebastian Andrzej Siewior, Kurt Kanzenbach, Andrew Lunn,
Vivien Didelot
Hi,
while working on a Banana Pi R1 based system I faced inconsistent
switch configurations. The switch is attached to an EEPROM which feeds
additional configuration which is applied after the reset of the chip.
As a result all ports remained active while the DSA subsystem
assumed that those ports were inactive after the reset.
Disable the ports on switch setup to get a consistent view of things
between real life and DSA.
Benedikt Spranger (1):
net: dsa: b53: Disable all ports on setup
drivers/net/dsa/b53/b53_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] net: dsa: b53: Disable all ports on setup
2019-06-28 16:58 [PATCH 0/1] Disable all ports on b53 setup Benedikt Spranger
@ 2019-06-28 16:58 ` Benedikt Spranger
2019-06-28 17:23 ` Florian Fainelli
0 siblings, 1 reply; 5+ messages in thread
From: Benedikt Spranger @ 2019-06-28 16:58 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, Sebastian Andrzej Siewior, Kurt Kanzenbach, Andrew Lunn,
Vivien Didelot
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] net: dsa: b53: Disable all ports on setup
2019-06-28 16:58 ` [PATCH 1/1] net: dsa: b53: Disable all ports on setup Benedikt Spranger
@ 2019-06-28 17:23 ` Florian Fainelli
2019-06-28 19:24 ` Vivien Didelot
2019-06-28 20:34 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Florian Fainelli @ 2019-06-28 17:23 UTC (permalink / raw)
To: Benedikt Spranger
Cc: netdev, Sebastian Andrzej Siewior, Kurt Kanzenbach, Andrew Lunn,
Vivien Didelot
On 6/28/19 9:58 AM, Benedikt Spranger wrote:
> 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>
Makes sense, in fact, that should probably be moved to the DSA core at
some point (wink wink Vivien).
--
Florian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] net: dsa: b53: Disable all ports on setup
2019-06-28 17:23 ` Florian Fainelli
@ 2019-06-28 19:24 ` Vivien Didelot
2019-06-28 20:34 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Vivien Didelot @ 2019-06-28 19:24 UTC (permalink / raw)
To: Florian Fainelli
Cc: Benedikt Spranger, netdev, Sebastian Andrzej Siewior,
Kurt Kanzenbach, Andrew Lunn
On Fri, 28 Jun 2019 10:23:06 -0700, Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 6/28/19 9:58 AM, Benedikt Spranger wrote:
> > 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>
>
> Makes sense, in fact, that should probably be moved to the DSA core at
> some point (wink wink Vivien).
On it!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] net: dsa: b53: Disable all ports on setup
2019-06-28 17:23 ` Florian Fainelli
2019-06-28 19:24 ` Vivien Didelot
@ 2019-06-28 20:34 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2019-06-28 20:34 UTC (permalink / raw)
To: f.fainelli; +Cc: b.spranger, netdev, bigeasy, kurt, andrew, vivien.didelot
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 28 Jun 2019 10:23:06 -0700
> On 6/28/19 9:58 AM, Benedikt Spranger wrote:
>> 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>
Applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-06-28 20:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 16:58 [PATCH 0/1] Disable all ports on b53 setup Benedikt Spranger
2019-06-28 16:58 ` [PATCH 1/1] net: dsa: b53: Disable all ports on setup Benedikt Spranger
2019-06-28 17:23 ` Florian Fainelli
2019-06-28 19:24 ` Vivien Didelot
2019-06-28 20:34 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.