Commit 5e5b39aa authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski
Browse files

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: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/E1umsfV-008vKv-1O@rmk-PC.armlinux.org.uk


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6a9a6ce9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4138,8 +4138,13 @@ static int stmmac_release(struct net_device *dev)
	struct stmmac_priv *priv = netdev_priv(dev);
	u32 chan;

	/* If the PHY or MAC has WoL enabled, then the PHY will not be
	 * suspended when phylink_stop() is called below. Set the PHY
	 * to its slowest speed to save power.
	 */
	if (device_may_wakeup(priv->device))
		phylink_speed_down(priv->phylink, false);

	/* Stop and disconnect the PHY */
	phylink_stop(priv->phylink);
	phylink_disconnect_phy(priv->phylink);