[PATCH v1] phy: avoid adjust_link call if link remains down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a check in phy_update_status to skip calling adjust_link when the
link status remains down. This prevents unnecessary adjust_link calls
for PHYs that may change speed and duplex status bits before confirming
link establishment. This issue was observed during debugging a switch
driver, where a PHY took about 6 seconds to establish a link, causing
multiple adjust_link calls.

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 drivers/net/phy/phy.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index abd78b2c80..39a48e1519 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -62,6 +62,9 @@ int phy_update_status(struct phy_device *phydev)
 	    phydev->link == oldlink)
 		return 0;
 
+	if (!phydev->link && phydev->link == oldlink)
+		return 0;
+
 	if (phydev->adjust_link)
 		phydev->adjust_link(edev);
 
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux