Skip to content

Commit

Permalink
net: dsa: lan9303: Do not disable switch fabric port 0 at .probe
Browse files Browse the repository at this point in the history
Make the LAN9303 work when lan9303_probe() is called twice.

For some unknown reason the LAN9303 switch fail to forward data when switch
fabric port 0 TX is disabled during probe. (Write of LAN9303_MAC_TX_CFG_0
in lan9303_disable_processing_port().)

In that situation the switch fabric seem to receive frames, because the ALR
is learning addresses. But no frames are transmitted on any of the ports.

In our system lan9303_probe() is called twice, first time
dsa_register_switch() return -EPROBE_DEFER. As an experiment, modified the
code to skip writing LAN9303_MAC_TX_CFG_0, port 0 during the first probe.
Then the switch works as expected.

Resolve the problem by not calling lan9303_disable_processing_port() on
port 0 during probe. Ports 1 and 2 are still disabled.

Although unsatisfying that the exact failure mechanism is not known,
the patch should not cause any harm.

Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Egil Hjelmeland authored and David S. Miller committed Oct 26, 2017
1 parent acfdf7e commit 3c91b0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/lan9303-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ static int lan9303_disable_processing(struct lan9303 *chip)
{
int p;

for (p = 0; p < LAN9303_NUM_PORTS; p++) {
for (p = 1; p < LAN9303_NUM_PORTS; p++) {
int ret = lan9303_disable_processing_port(chip, p);

if (ret)
Expand Down

0 comments on commit 3c91b0c

Please sign in to comment.