OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c1a92c0
)
net: phy: avoid unneeded MDIO reads in genphy_read_status
author
Heiner Kallweit
<hkallweit1@gmail.com>
Wed, 24 Apr 2019 19:49:30 +0000
(21:49 +0200)
committer
David S. Miller
<davem@davemloft.net>
Sun, 28 Apr 2019 23:48:04 +0000
(19:48 -0400)
Considering that in polling mode each link drop will be latched,
settings can't have changed if link was up and is up.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c
patch
|
blob
|
history
diff --git
a/drivers/net/phy/phy_device.c
b/drivers/net/phy/phy_device.c
index
f794ff3
..
2a2aaa5
100644
(file)
--- a/
drivers/net/phy/phy_device.c
+++ b/
drivers/net/phy/phy_device.c
@@
-1739,13
+1739,17
@@
EXPORT_SYMBOL(genphy_update_link);
*/
int genphy_read_status(struct phy_device *phydev)
{
- int adv, lpa, lpagb, err;
+ int adv, lpa, lpagb, err
, old_link = phydev->link
;
/* Update the link, but return if there was an error */
err = genphy_update_link(phydev);
if (err)
return err;
+ /* why bother the PHY if nothing can have changed */
+ if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
+ return 0;
+
phydev->speed = SPEED_UNKNOWN;
phydev->duplex = DUPLEX_UNKNOWN;
phydev->pause = 0;