linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: lan9303: Do not disable switch fabric port 0 at .probe
@ 2017-10-24 15:14 Egil Hjelmeland
  2017-10-24 16:27 ` Andrew Lunn
  2017-10-26  8:41 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Egil Hjelmeland @ 2017-10-24 15:14 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, netdev, linux-kernel; +Cc: Egil Hjelmeland

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>
---
 drivers/net/dsa/lan9303-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index 87f919f0e641..4c412bd52319 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -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)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: dsa: lan9303: Do not disable switch fabric port 0 at .probe
  2017-10-24 15:14 [PATCH net-next] net: dsa: lan9303: Do not disable switch fabric port 0 at .probe Egil Hjelmeland
@ 2017-10-24 16:27 ` Andrew Lunn
  2017-10-26  8:41 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2017-10-24 16:27 UTC (permalink / raw)
  To: Egil Hjelmeland; +Cc: vivien.didelot, f.fainelli, netdev, linux-kernel

On Tue, Oct 24, 2017 at 05:14:10PM +0200, Egil Hjelmeland wrote:
> 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.

I agree about this being unsatisfying, but as you said, it fixed your
issue, and it probably does not cause other issues.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: dsa: lan9303: Do not disable switch fabric port 0 at .probe
  2017-10-24 15:14 [PATCH net-next] net: dsa: lan9303: Do not disable switch fabric port 0 at .probe Egil Hjelmeland
  2017-10-24 16:27 ` Andrew Lunn
@ 2017-10-26  8:41 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-10-26  8:41 UTC (permalink / raw)
  To: privat; +Cc: andrew, vivien.didelot, f.fainelli, netdev, linux-kernel

From: Egil Hjelmeland <privat@egil-hjelmeland.no>
Date: Tue, 24 Oct 2017 17:14:10 +0200

> 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>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-26  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 15:14 [PATCH net-next] net: dsa: lan9303: Do not disable switch fabric port 0 at .probe Egil Hjelmeland
2017-10-24 16:27 ` Andrew Lunn
2017-10-26  8:41 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).