Commit 7028471e authored by Christian Marangi's avatar Christian Marangi Committed by Jakub Kicinski

net: ethernet: stmicro: stmmac: first disable all queues and disconnect in release

Disable all queues and disconnect before tx_disable in stmmac_release to
prevent a corner case where packet may be still queued at the same time
tx_disable is called resulting in kernel panic if some packet still has
to be processed.
Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f9ec5723
...@@ -3757,8 +3757,6 @@ static int stmmac_release(struct net_device *dev) ...@@ -3757,8 +3757,6 @@ static int stmmac_release(struct net_device *dev)
struct stmmac_priv *priv = netdev_priv(dev); struct stmmac_priv *priv = netdev_priv(dev);
u32 chan; u32 chan;
netif_tx_disable(dev);
if (device_may_wakeup(priv->device)) if (device_may_wakeup(priv->device))
phylink_speed_down(priv->phylink, false); phylink_speed_down(priv->phylink, false);
/* Stop and disconnect the PHY */ /* Stop and disconnect the PHY */
...@@ -3770,6 +3768,8 @@ static int stmmac_release(struct net_device *dev) ...@@ -3770,6 +3768,8 @@ static int stmmac_release(struct net_device *dev)
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++) for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
hrtimer_cancel(&priv->tx_queue[chan].txtimer); hrtimer_cancel(&priv->tx_queue[chan].txtimer);
netif_tx_disable(dev);
/* Free the IRQ lines */ /* Free the IRQ lines */
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0); stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
......
Markdown is supported
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