summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-27 19:22:23 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-27 19:22:23 +0100
commitd19f1d44e74322ae2a75dc07b7d44fecacd5bcfb (patch)
treeee8127be714d3ed59b31266aaaee2fb1d17a815a /drivers/net/phy/phy_device.c
parentabb0b3d96a1f9407dd66831ae33985a386d4200d (diff)
parentd6d5df1db6e9d7f8f76d2911707f7d5877251b02 (diff)
downloadlinux-d19f1d44e74322ae2a75dc07b7d44fecacd5bcfb.tar.gz
linux-d19f1d44e74322ae2a75dc07b7d44fecacd5bcfb.tar.bz2
linux-d19f1d44e74322ae2a75dc07b7d44fecacd5bcfb.zip
Merge 5.4-rc5 into usb-next
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 9d2bbb13293e..adb66a2fae18 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1787,7 +1787,14 @@ int genphy_read_lpa(struct phy_device *phydev)
{
int lpa, lpagb;
- if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
+ if (phydev->autoneg == AUTONEG_ENABLE) {
+ if (!phydev->autoneg_complete) {
+ mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising,
+ 0);
+ mii_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, 0);
+ return 0;
+ }
+
if (phydev->is_gigabit_capable) {
lpagb = phy_read(phydev, MII_STAT1000);
if (lpagb < 0)
@@ -1815,6 +1822,8 @@ int genphy_read_lpa(struct phy_device *phydev)
return lpa;
mii_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, lpa);
+ } else {
+ linkmode_zero(phydev->lp_advertising);
}
return 0;