[PATCH] net: phy: Only resume phy if it is suspended

From: Justin Chen
Date: Tue Dec 05 2023 - 18:42:40 EST


Resuming the phy can take quite a bit of time. Lets only resume the
phy if it is suspended.

Signed-off-by: Justin Chen <justin.chen@xxxxxxxxxxxx>
---
drivers/net/phy/phy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 3376e58e2b88..7fbb21922d64 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1549,7 +1549,8 @@ void phy_start(struct phy_device *phydev)
sfp_upstream_start(phydev->sfp_bus);

/* if phy was suspended, bring the physical link up again */
- __phy_resume(phydev);
+ if (phydev->suspended)
+ __phy_resume(phydev);

phydev->state = PHY_UP;

--
2.34.1

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature