net: dsa: mv88e6xxx: Link in pcs_get_state() if AN is bypassed
authorMarek Behún <kabel@kernel.org>
Tue, 30 Nov 2021 17:01:51 +0000 (18:01 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Dec 2021 14:39:10 +0000 (14:39 +0000)
commitede359d8843a2779d232ed30bc36089d4b5962e4
treed4a69fcd8fca6546fb466bbb4f0b83e5afe9c843
parent163000dbc772c1eae9bdfe7c8fe30155db1efd74
net: dsa: mv88e6xxx: Link in pcs_get_state() if AN is bypassed

Function mv88e6xxx_serdes_pcs_get_state() currently does not report link
up if AN is enabled, Link bit is set, but Speed and Duplex Resolved bit
is not set, which testing shows is the case for when auto-negotiation
was bypassed (we have AN enabled but link partner does not).

An example of such link partner is Marvell 88X3310 PHY, when put into
the mode where host interface changes between 10gbase-r, 5gbase-r,
2500base-x and sgmii according to copper speed. The 88X3310 does not
enable AN in 2500base-x, and so SerDes on mv88e6xxx currently does not
link with it.

Fix this.

Fixes: a5a6858b793f ("net: dsa: mv88e6xxx: extend phylink to Serdes PHYs")
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/serdes.c