Yonglong Liu 3de5ae5471 net: phy: Fix "link partner" information disappear issue
Some drivers just call phy_ethtool_ksettings_set() to set the
links, for those phy drivers that use genphy_read_status(), if
autoneg is on, and the link is up, than execute "ethtool -s
ethx autoneg on" will cause "link partner" information disappear.

The call trace is phy_ethtool_ksettings_set()->phy_start_aneg()
->linkmode_zero(phydev->lp_advertising)->genphy_read_status(),
the link didn't change, so genphy_read_status() just return, and
phydev->lp_advertising is zero now.

This patch moves the clear operation of lp_advertising from
phy_start_aneg() to genphy_read_lpa()/genphy_c45_read_lpa(), and
if autoneg on and autoneg not complete, just clear what the
generic functions care about.

Fixes: 88d6272acaaa ("net: phy: avoid unneeded MDIO reads in genphy_read_status")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-16 13:17:01 -07:00
..
2019-09-22 09:39:09 -07:00
2019-09-24 15:54:11 -07:00
2019-10-04 09:56:51 -07:00
2019-09-30 10:04:28 -07:00
2019-09-29 11:20:41 -07:00
2019-09-22 09:30:30 -07:00
2019-09-22 09:39:09 -07:00
2019-09-19 14:14:28 -07:00
2019-09-30 10:04:28 -07:00
2019-09-18 11:14:31 -07:00
2019-09-27 12:19:47 -07:00
2019-10-04 16:31:06 +10:00
2019-09-22 12:02:21 -07:00
2019-09-29 11:20:41 -07:00
2019-09-28 20:44:12 +02:00
2019-09-19 14:14:28 -07:00
2019-09-19 14:14:28 -07:00
2019-09-29 10:00:14 -07:00
2019-09-22 09:30:30 -07:00
2019-09-24 16:31:50 -07:00
2019-09-22 09:30:30 -07:00
2019-09-23 17:20:40 -04:00
2019-09-29 10:33:41 -07:00
2019-09-19 13:27:23 -07:00
2019-09-23 19:16:01 -07:00
2019-09-24 12:39:40 -07:00
2019-09-27 12:19:47 -07:00
2019-09-17 18:40:42 -07:00
2019-09-22 10:55:08 -07:00
2019-09-30 10:04:28 -07:00
2019-09-22 11:05:43 -07:00
2019-10-05 12:53:27 -07:00
2019-09-16 15:52:38 -07:00
2019-09-22 10:52:23 -07:00
2019-09-17 18:40:42 -07:00
2019-09-24 15:54:08 -07:00
2019-09-18 11:14:31 -07:00
2019-09-27 11:17:38 -07:00
2019-09-18 11:05:34 -07:00