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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:43 +0000 (10:19 +0200)
commit20dbf6a255a10596fe30a2075b85beb80cd7885b
treeb6a73f6bf9ef8b79a959e76bd0e700a065432e0e
parentd3ecfc5c28fd4881a53c3d395768383beffd0edc
net: dsa: mv88e6xxx: fix in-band AN link establishment

[ Upstream commit fad58190c0ffd72c394722928cd3e919b6e18357 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/chip.h