aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-07-08 07:40:28 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-08 23:02:59 -0400
commit9a7ba4381af4defa7834c73c8a015532c06f4e8e (patch)
treec10d2d9cc5e2aab26c948a6ab62cd3b90fb0ba78
parent31a6de34f3daa9b1f412931befd9f82fd4a1b968 (diff)
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: Fugang Duan <B38611@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fc9f6f465e7a..2945cf6e65cf 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2362,9 +2362,9 @@ static int fec_set_features(struct net_device *netdev,
2362 fep->csum_flags &= ~FLAG_RX_CSUM_ENABLED; 2362 fep->csum_flags &= ~FLAG_RX_CSUM_ENABLED;
2363 2363
2364 if (netif_running(netdev)) { 2364 if (netif_running(netdev)) {
2365 fec_stop(netdev);
2366 napi_disable(&fep->napi); 2365 napi_disable(&fep->napi);
2367 netif_tx_lock_bh(netdev); 2366 netif_tx_lock_bh(netdev);
2367 fec_stop(netdev);
2368 fec_restart(netdev, fep->phy_dev->duplex); 2368 fec_restart(netdev, fep->phy_dev->duplex);
2369 netif_wake_queue(netdev); 2369 netif_wake_queue(netdev);
2370 netif_tx_unlock_bh(netdev); 2370 netif_tx_unlock_bh(netdev);