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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:45 +0000 (09:04 +0100)
commit326fb8a1c26784c254ef64e79aad8a2f3d0b00ec
treeb4f63b87507b177af7ee45ea262a8337ccb9ace4
parent19f7ad89bcb7d5edef3ad02272c993458ee8a4f4
net: dsa: mv88e6xxx: Link in pcs_get_state() if AN is bypassed

commit ede359d8843a2779d232ed30bc36089d4b5962e4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/mv88e6xxx/serdes.c