Thread (13 messages) 13 messages, 5 authors, 2021-12-14

[PATCH net-next] net: phy: perform a PHY reset on resume

flat view
STALE1764d

From: Francesco Dolcini <hidden>
Date: 2021-12-11 13:02:28
Also in: lkml
Subsystem: ethernet phy library, networking drivers, the rest · Maintainers: Andrew Lunn, Heiner Kallweit, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Perform a PHY reset in phy_init_hw() to ensure that the PHY is working
after resume. This is required if the PHY was powered down in suspend
like it is done by the freescale FEC driver in fec_suspend().

Link: https://lore.kernel.org/netdev/20211206101326.1022527-1-philippe.schenker@toradex.com/ (local)
Signed-off-by: Francesco Dolcini <redacted>

---

Philippe: what about something like that? Only compile tested, but I see no reason for this not solving the issue.

Any delay required on the reset can be specified using reset-assert-us/reset-deassert-us.

---
 drivers/net/phy/phy_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 74d8e1dc125f..7eab0c054adf 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1158,7 +1158,8 @@ int phy_init_hw(struct phy_device *phydev)
 {
 	int ret = 0;
 
-	/* Deassert the reset signal */
+	/* phy reset required if the phy was powered down during suspend */
+	phy_device_reset(phydev, 1);
 	phy_device_reset(phydev, 0);
 
 	if (!phydev->drv)
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help