Skip to content

Commit 63f7016

Browse files
Russell King (Oracle)NipaLocal
authored andcommitted
net: stmmac: explain the phylink_speed_down() call in stmmac_release()
The call to phylink_speed_down() looks odd on the face of it. Add a comment to explain why this call is there. phylink_speed_up() is always called in __stmmac_open(), and already has a comment. Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 86aa4a5 commit 63f7016

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4138,8 +4138,13 @@ static int stmmac_release(struct net_device *dev)
41384138
struct stmmac_priv *priv = netdev_priv(dev);
41394139
u32 chan;
41404140

4141+
/* If the PHY or MAC has WoL enabled, then the PHY will not be
4142+
* suspended when phylink_stop() is called below. Set the PHY
4143+
* to its slowest speed to save power.
4144+
*/
41414145
if (device_may_wakeup(priv->device))
41424146
phylink_speed_down(priv->phylink, false);
4147+
41434148
/* Stop and disconnect the PHY */
41444149
phylink_stop(priv->phylink);
41454150
phylink_disconnect_phy(priv->phylink);

0 commit comments

Comments
 (0)