net: phy: fix marvell phy status reading
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 30 May 2017 15:21:51 +0000 (16:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2017 10:48:53 +0000 (12:48 +0200)
commit 898805e0cdf7fd860ec21bf661d3a0285a3defbd upstream.

The Marvell driver incorrectly provides phydev->lp_advertising as the
logical and of the link partner's advert and our advert.  This is
incorrect - this field is supposed to store the link parter's unmodified
advertisment.

This allows ethtool to report the correct link partner auto-negotiation
status.

Fixes: be937f1f89ca ("Marvell PHY m88e1111 driver fix")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/marvell.c

index d2701c53ed681b55138de764d53bafa9bb911509..ebec2dceff4525e4c62969090daa7498186d0881 100644 (file)
@@ -822,8 +822,6 @@ static int marvell_read_status(struct phy_device *phydev)
                phydev->lp_advertising = mii_stat1000_to_ethtool_lpa_t(lpagb) |
                                         mii_lpa_to_ethtool_lpa_t(lpa);
 
-               lpa &= adv;
-
                if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
                        phydev->duplex = DUPLEX_FULL;
                else