]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: fix autoneg mismatch case in genphy_read_status
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 2 Apr 2019 18:43:30 +0000 (20:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Apr 2019 04:47:54 +0000 (21:47 -0700)
commit4e89e2b38abc0d6a958b7efc6eca6d68e83093e5
treee1bea0ceb1887369c734f6a48b5bbbc2a916ff81
parentadb84b13d9c14d91a8f6176d2d3c07c365e3bd15
net: phy: fix autoneg mismatch case in genphy_read_status

The original patch didn't consider the case that autoneg process
finishes successfully but both link partners have no mode in common.
In this case there's no link, nevertheless we may be interested in
what the link partner advertised.

Like phydev->link we set phydev->autoneg_complete in
genphy_update_link() and use the stored value in genphy_read_status().
This way we don't have to read register BMSR again.

Fixes: 9ac25b1c8bd1 ("net: phy: improve genphy_read_status")
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_device.c
include/linux/phy.h