diff mbox series

[net,1/4] net:phy:smsc: enable PHY_RST_AFTER_CLK_EN if ref clock is not set

Message ID CY4PR1701MB18781C29E0D94E7842A1DBCADF160@CY4PR1701MB1878.namprd17.prod.outlook.com
State Changes Requested
Delegated to: David Miller
Headers show
Series [net,1/4] net:phy:smsc: enable PHY_RST_AFTER_CLK_EN if ref clock is not set | expand

Checks

Context Check Description
jkicinski/cover_letter warning Series does not have a cover letter
jkicinski/fixes_present success Link
jkicinski/patch_count success Link
jkicinski/tree_selection success Clearly marked for net
jkicinski/subject_prefix success Link
jkicinski/source_inline success Was 0 now: 0
jkicinski/verify_signedoff success Link
jkicinski/module_param success Was 0 now: 0
jkicinski/build_32bit fail Errors and warnings before: 4 this patch: 4
jkicinski/kdoc success Errors and warnings before: 0 this patch: 0
jkicinski/verify_fixes fail Link
jkicinski/checkpatch fail Link
jkicinski/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
jkicinski/header_inline success Link
jkicinski/stable success Stable not CCed

Commit Message

Laurent Badel Oct. 27, 2020, 11:26 p.m. UTC
Subject: [PATCH net 1/4] net:phy:smsc: enable PHY_RST_AFTER_CLK_EN if ref clock is not set

Description: for compatibility, restore PHY_RST_AFTER_CLK_EN flag for 
LAN8720, but clear it if the driver successfully retrieves a reference to
the ref clk. This ensures compatibility for systems that rely on the PHY
reset workaround, but fail to update their DT with the 'clocks' property
for SMSC PHY.

Signed-off-by: Laurent Badel <laurentbadel@eaton.com>
Fixes: d65af21842f8 ("net: phy: smsc: LAN8710/20: remove PHY_RST_AFTER_CLK_EN 
flag")
---
 drivers/net/phy/smsc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index ec97669be5c2..321ed2a89045 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -294,6 +294,9 @@  static int smsc_phy_probe(struct phy_device *phydev)
 	if (ret)
 		return ret;
 
+	if (priv->refclk)
+		phydev->drv->flags &= ~PHY_RST_AFTER_CLK_EN;
+
 	return 0;
 }
 
@@ -397,7 +400,7 @@  static struct phy_driver smsc_phy_driver[] = {
 	.name		= "SMSC LAN8710/LAN8720",
 
 	/* PHY_BASIC_FEATURES */
-
+	.flags		= PHY_RST_AFTER_CLK_EN,
 	.probe		= smsc_phy_probe,
 	.remove		= smsc_phy_remove,