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 (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: phy: Fix SMSC LAN87xx external reset | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: hkallweit1@gmail.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

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);