net: phy: marvell: fix Marvell 88E1512 used in SGMII mode
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 10 Jan 2017 23:13:45 +0000 (23:13 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:05:43 +0000 (03:05 +0000)
commitfa93343705ad9e77e656bb37f36623e5d341e4c0
tree509d13345d2cd71a09f4f34f99bfd16fd1154e27
parent38237a747b8d1e48343e339baf763cea58d10c9b
net: phy: marvell: fix Marvell 88E1512 used in SGMII mode

[ Upstream commit a13c06525ab9ff442924e67df9393a5efa914c56 ]

When an Marvell 88E1512 PHY is connected to a nic in SGMII mode, the
fiber page is used for the SGMII host-side connection.  The PHY driver
notices that SUPPORTED_FIBRE is set, so it tries reading the fiber page
for the link status, and ends up reading the MAC-side status instead of
the outgoing (copper) link.  This leads to incorrect results reported
via ethtool.

If the PHY is connected via SGMII to the host, ignore the fiber page.
However, continue to allow the existing power management code to
suspend and resume the fiber page.

Fixes: 6cfb3bcc0641 ("Marvell phy: check link status in case of fiber link.")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/marvell.c