Commit 3e2bf04f authored by Jose Abreu's avatar Jose Abreu Committed by David S. Miller
Browse files

net: stmmac: Do not stop PHY if WoL is enabled

If WoL is enabled we can't really stop the PHY, otherwise we will not
receive the WoL packet. Fix this by telling phylink that only the MAC is
down and only stop the PHY if WoL is not enabled.

Fixes: 74371272

 ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: default avatarJose Abreu <>
Signed-off-by: default avatarDavid S. Miller <>
parent 14f34733
...@@ -4718,9 +4718,7 @@ int stmmac_suspend(struct device *dev) ...@@ -4718,9 +4718,7 @@ int stmmac_suspend(struct device *dev)
mutex_lock(&priv->lock); mutex_lock(&priv->lock);
rtnl_lock(); phylink_mac_change(priv->phylink, false);
netif_device_detach(ndev); netif_device_detach(ndev);
stmmac_stop_all_queues(priv); stmmac_stop_all_queues(priv);
...@@ -4735,6 +4733,10 @@ int stmmac_suspend(struct device *dev) ...@@ -4735,6 +4733,10 @@ int stmmac_suspend(struct device *dev)
stmmac_pmt(priv, priv->hw, priv->wolopts); stmmac_pmt(priv, priv->hw, priv->wolopts);
priv->irq_wake = 1; priv->irq_wake = 1;
} else { } else {
stmmac_mac_set(priv, priv->ioaddr, false); stmmac_mac_set(priv, priv->ioaddr, false);
pinctrl_pm_select_sleep_state(priv->device); pinctrl_pm_select_sleep_state(priv->device);
/* Disable clock in case of PWM is off */ /* Disable clock in case of PWM is off */
...@@ -4825,9 +4827,13 @@ int stmmac_resume(struct device *dev) ...@@ -4825,9 +4827,13 @@ int stmmac_resume(struct device *dev)
stmmac_start_all_queues(priv); stmmac_start_all_queues(priv);
rtnl_lock(); if (!device_may_wakeup(priv->device)) {
phylink_start(priv->phylink); rtnl_lock();
rtnl_unlock(); phylink_start(priv->phylink);
phylink_mac_change(priv->phylink, true);
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment