]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: Prevent PHY jabbering during switch reset
authorVladimir Oltean <olteanv@gmail.com>
Thu, 2 May 2019 20:23:37 +0000 (23:23 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 May 2019 14:49:17 +0000 (10:49 -0400)
commit396eae067f1a4d9c454c7fb18a41954d0c91381a
treeb0854515b6c47fde98d7e089defdac27ee72b3bf
parent0d5a280fcd19db1d716d6de03854a9fdd415cd0d
net: dsa: sja1105: Prevent PHY jabbering during switch reset

Resetting the switch at runtime is currently done while changing the
vlan_filtering setting (due to the required TPID change).

But reset is asynchronous with packet egress, and the switch core will
not wait for egress to finish before carrying on with the reset
operation.

As a result, a connected PHY such as the BCM5464 would see an
unterminated Ethernet frame and start to jabber (repeat the last seen
Ethernet symbols - jabber is by definition an oversized Ethernet frame
with bad FCS). This behavior is strange in itself, but it also causes
the MACs of some link partners (such as the FRDM-LS1012A) to completely
lock up.

So as a remedy for this situation, when switch reset is required, simply
inhibit Tx on all ports, and wait for the necessary time for the
eventual one frame left in the egress queue (not even the Tx inhibit
command is instantaneous) to be flushed.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105.h
drivers/net/dsa/sja1105/sja1105_spi.c