diff mbox series

[v4,net-next,2/5] net: phy: Hold SMSC LAN87xx in reset after probe

Message ID MW4PR17MB42434377E041B7B429002679DFA40@MW4PR17MB4243.namprd17.prod.outlook.com
State New
Headers show
Series None | expand

Commit Message

Badel, Laurent Jan. 18, 2021, 4:59 p.m. UTC
Assert PHY reset at the end of phy_probe(), for PHYs bearing the
PHY_RST_AFTER_PROBE flag. For FEC-based devices this ensures that PHYs are
always in reset or power-down whenever the REF_CLK is turned off.

Signed-off-by: Laurent Badel <laurentbadel@eaton.com>
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8447e56ba572..bbf794f0935a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2926,7 +2926,7 @@  static int phy_probe(struct device *dev)
 
 out:
 	/* Assert the reset signal */
-	if (err)
+	if (err || phydev->drv->flags & PHY_RST_AFTER_PROBE)
 		phy_device_reset(phydev, 1);
 
 	mutex_unlock(&phydev->lock);