diff options
author | Russell King (Oracle) <[email protected]> | 2024-03-26 14:32:12 +0100 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2024-03-28 19:21:34 -0700 |
commit | 30dc5873967ecc0282a8283622156cba4be8daf4 (patch) | |
tree | 3614ca3a635eafea06b84632067e6ee24b494c0e | |
parent | 58329b03a5957904fa2b33b3824ed19e7b42c9e9 (diff) |
net: phy: qcom: at803x: Avoid hibernating if MAC requires RX clock
Stmmac controllers connected to an at803x PHY cannot resume properly after
suspend when WoL is enabled. This happens because the MAC requires an RX
clock generated by the PHY to initialize its hardware properly. But the RX
clock is cut when the PHY suspends and isn't brought up until the MAC
driver resumes the phylink.
Prevent the at803x PHY driver from going into suspend if the attached MAC
driver always requires an RX clock signal.
Reported-by: Clark Wang <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Russell King (Oracle) <[email protected]>
[rgantois: commit log]
Signed-off-by: Romain Gantois <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r-- | drivers/net/phy/qcom/at803x.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/phy/qcom/at803x.c b/drivers/net/phy/qcom/at803x.c index e79657f76bea..c8f83e5f78ab 100644 --- a/drivers/net/phy/qcom/at803x.c +++ b/drivers/net/phy/qcom/at803x.c @@ -426,7 +426,8 @@ static int at803x_hibernation_mode_config(struct phy_device *phydev) /* The default after hardware reset is hibernation mode enabled. After * software reset, the value is retained. */ - if (!(priv->flags & AT803X_DISABLE_HIBERNATION_MODE)) + if (!(priv->flags & AT803X_DISABLE_HIBERNATION_MODE) && + !(phydev->dev_flags & PHY_F_RXC_ALWAYS_ON)) return 0; return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_HIB_CTRL, |