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

net: fec: quiesce packet processing before stopping device in fec_set_features()

fec_set_features() calls fec_stop() to stop the transmit ring while the
transmit queue is still active.  This can lead to the transmit ring
being restarted by an intervening packet queued for transmission, or
by the tx quirk timer expiring.

Fix this by disabling NAPI (which ensures that the NAPI handlers are
not running), and then take the transmit lock while we stop and
restart the adapter (which prevents new packets being queued).
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 31a6de34
......@@ -2362,9 +2362,9 @@ static int fec_set_features(struct net_device *netdev,
fep->csum_flags &= ~FLAG_RX_CSUM_ENABLED;
if (netif_running(netdev)) {
fec_stop(netdev);
napi_disable(&fep->napi);
netif_tx_lock_bh(netdev);
fec_stop(netdev);
fec_restart(netdev, fep->phy_dev->duplex);
netif_wake_queue(netdev);
netif_tx_unlock_bh(netdev);
......
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