net: dsa: mv88e6xxx: fix in-band AN link establishment
authorRussell King <rmk+kernel@armlinux.org.uk>
Sun, 19 Jul 2020 11:00:35 +0000 (12:00 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Jul 2020 01:08:54 +0000 (18:08 -0700)
commitfad58190c0ffd72c394722928cd3e919b6e18357
treea3f4d9b8d616e70d4d0842bda77a75193b15d590
parenta463fa2cda5641c12da76d115a3490aee01d0377
net: dsa: mv88e6xxx: fix in-band AN link establishment

If in-band negotiation or fixed-link modes are specified for a DSA
port, the DSA code will force the link down during initialisation. For
fixed-link mode, this is fine, as phylink will manage the link state.
However, for in-band mode, phylink expects the PCS to detect link,
which will not happen if the link is forced down.

There is a related issue that in in-band mode, the link could come up
while we are making configuration changes, so we should force the link
down prior to reconfiguring the interface mode.

This patch addresses both issues.

Fixes: 3be98b2d5fbc ("net: dsa: Down cpu/dsa ports phylink will control")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/chip.h