Subject: Re: bug: net: dsa: mv88e6xxx: unable to tx or rx with Clearfog GT 8K (with git bisect)

From: Russell King - ARM Linux admin <[email-masked]>
Date: Sat, 18 Jul 2020 11:12:59 +0100

On Sat, Jul 18, 2020 at 09:43:47AM +0000, Martin Rowe wrote:
> On Sat, 18 Jul 2020 at 08:50, Russell King - ARM Linux admin
> <[email-masked]> wrote:
> > Sorry, it should have been ``managed = "in-band-status";'' rather than
> > just "in-band".
> 
> Below are the outputs with "in-band-status". It functions the same as
> not reverting the patch; interface comes up, when bridged the two
> physical machines connected can ping each other, but nothing can tx or
> rx from the GT 8K.

Okay, on top of those changes, please also add this:

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 17883e8712e0..2e361bbf3b4f 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -676,6 +676,9 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
 		return;
 
 	mv88e6xxx_reg_lock(chip);
+	if (mode == MLO_AN_INBAND && chip->info->ops->port_set_link)
+		chip->info->ops->port_set_link(chip, port, LINK_FORCED_DOWN);
+
 	/* FIXME: should we force the link down here - but if we do, how
 	 * do we restore the link force/unforce state? The driver layering
 	 * gets in the way.
@@ -692,6 +695,9 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
 	if (err > 0)
 		err = 0;
 
+	if (mode == MLO_AN_INBAND && chip->info->ops->port_set_link)
+		chip->info->ops->port_set_link(chip, port, LINK_UNFORCED);
+
 err_unlock:
 	mv88e6xxx_reg_unlock(chip);
 
-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!