netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: Only resume phy if it is suspended
@ 2023-12-05 23:42 Justin Chen
  2023-12-06  0:03 ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Justin Chen @ 2023-12-05 23:42 UTC (permalink / raw)
  To: netdev
  Cc: bcm-kernel-feedback-list, florian.fainelli, Justin Chen,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, open list

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

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@broadcom.com>
---
 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 #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4206 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-08 17:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 23:42 [PATCH] net: phy: Only resume phy if it is suspended Justin Chen
2023-12-06  0:03 ` Andrew Lunn
2023-12-06  0:10   ` Justin Chen
2023-12-06  0:12     ` Florian Fainelli
2023-12-07 17:56       ` Florian Fainelli
2023-12-07 18:50         ` Russell King (Oracle)
2023-12-08 17:36           ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).