]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: deal properly with autoneg incomplete in genphy_c45_read_lpa
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 31 Mar 2019 17:54:07 +0000 (19:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Apr 2019 20:16:17 +0000 (13:16 -0700)
commit68dcecc58b7cd847f67a057b9918788c73936cb0
treeb5bf6c846595526713022e0ee9f82bc05907f9e9
parent94e6a9ffc80182de39904d35cd498dc4e51b969a
net: phy: deal properly with autoneg incomplete in genphy_c45_read_lpa

The link partner advertisement registers are not guaranteed to contain
valid values if autoneg is incomplete. Therefore, if
MDIO_AN_STAT1_COMPLETE isn't set, let's clear all link partner
capability bits. This also avoids unnecessary register reads if link
is down and phylib is in polling mode.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy-c45.c