Commit b49cd504 authored by Russell King's avatar Russell King Committed by David S. Miller

net: fec: use netif_tx_disable() rather than netif_stop_queue()

We use netif_stop_queue() in several places where we want to ensure that
the start_xmit function is not running.  netif_stop_queue() is not
sufficient to achieve that - it merely sets a flag to indicate that the
transmit queue(s) should not be run.

netif_tx_disable() gives this guarantee, since it takes the transmit
queue lock while marking the queue stopped.  This will wait for the
transmit function to complete before returning.
Acked-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7a16807c
...@@ -834,7 +834,7 @@ fec_restart(struct net_device *ndev, int duplex) ...@@ -834,7 +834,7 @@ fec_restart(struct net_device *ndev, int duplex)
if (netif_running(ndev)) { if (netif_running(ndev)) {
netif_device_detach(ndev); netif_device_detach(ndev);
napi_disable(&fep->napi); napi_disable(&fep->napi);
netif_stop_queue(ndev); netif_tx_disable(ndev);
netif_tx_lock_bh(ndev); netif_tx_lock_bh(ndev);
} }
...@@ -2181,7 +2181,7 @@ fec_enet_close(struct net_device *ndev) ...@@ -2181,7 +2181,7 @@ fec_enet_close(struct net_device *ndev)
/* Don't know what to do yet. */ /* Don't know what to do yet. */
napi_disable(&fep->napi); napi_disable(&fep->napi);
fep->opened = 0; fep->opened = 0;
netif_stop_queue(ndev); netif_tx_disable(ndev);
fec_stop(ndev); fec_stop(ndev);
if (fep->phy_dev) { if (fep->phy_dev) {
......
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