]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: consider AN_RESTART status when reading link status
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 12 Aug 2019 19:20:02 +0000 (21:20 +0200)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 14 Aug 2019 02:49:01 +0000 (19:49 -0700)
commit32fa1e80326cd29902918e79a0fec62c7e1372f6
treee69293ccf57f397f47ee8e9297ab813f9151d190
parent5eead6f087cec3e86c6e5d85ffd922e72ae0a801
net: phy: consider AN_RESTART status when reading link status

After configuring and restarting aneg we immediately try to read the
link status. On some systems the PHY may not yet have cleared the
"aneg complete" and "link up" bits, resulting in a false link-up
signal. See [0] for a report.
Clause 22 and 45 both require the PHY to keep the AN_RESTART
bit set until the PHY actually starts auto-negotiation.
Let's consider this in the generic functions for reading link status.
The commit marked as fixed is the first one where the patch applies
cleanly.

[0] https://marc.info/?t=156518400300003&r=1&w=2

Fixes: 039f6cc197e5 ("net: phy: check PMAPMD link status only in genphy_c45_read_link")
Tested-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/phy/phy-c45.c
drivers/net/phy/phy_device.c