summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2021-09-28 12:14:52 -0300
committerGitHub <noreply@github.com>2021-09-28 12:14:52 -0300
commit09a7977be879b5c2f055122df4992d2c8b7f2588 (patch)
tree0a01a572a28a0e1a74a29d6c0dfbe33ddf6a03d8 /drivers/net
parent5e2f889a8a3a0b326eb96497906bc7bcb6bcb743 (diff)
parent913880358f41e59f87e72ec9bb2601a6a4f5d589 (diff)
Merge pull request #458 from zandrey/5.4-2.3.x-imx
[EOL]: Update 5.4-2.3.x-imx up to v5.4.149
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/phy-c45.c5
-rw-r--r--drivers/net/phy/phy_device.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index a1caeee12236..bceb0dcdecbd 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -239,9 +239,10 @@ int genphy_c45_read_link(struct phy_device *phydev)
/* The link state is latched low so that momentary link
* drops can be detected. Do not double-read the status
- * in polling mode to detect such short link drops.
+ * in polling mode to detect such short link drops except
+ * the link was already down.
*/
- if (!phy_polling_mode(phydev)) {
+ if (!phy_polling_mode(phydev) || !phydev->link) {
val = phy_read_mmd(phydev, devad, MDIO_STAT1);
if (val < 0)
return val;
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index c02612787bfd..6ce2a00a8531 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1775,9 +1775,10 @@ int genphy_update_link(struct phy_device *phydev)
/* The link state is latched low so that momentary link
* drops can be detected. Do not double-read the status
- * in polling mode to detect such short link drops.
+ * in polling mode to detect such short link drops except
+ * the link was already down.
*/
- if (!phy_polling_mode(phydev)) {
+ if (!phy_polling_mode(phydev) || !phydev->link) {
status = phy_read(phydev, MII_BMSR);
if (status < 0)
return status;