summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-07-08 15:40:38 +0400
committerDavid S. Miller <davem@davemloft.net>2014-07-09 07:02:59 +0400
commitf208ce10046888052d3a5e9fc88b7c1b819877d2 (patch)
treeb1e30de5990b75edcb4f0a4fe2bf72068665230d /drivers/net/ethernet/freescale
parent8506fa1d8eb36fbf96ab5e2a7e4b87826853f1be (diff)
downloadlinux-f208ce10046888052d3a5e9fc88b7c1b819877d2.tar.xz
net: fec: quiesce packet processing when taking link down in fec_enet_adjust_link()
When the link goes down, the adjust_link method will be called, but there is no synchronisation to ensure that we won't be processing some last remaining packets via the NAPI handlers while performing a reset of the device. Add the necessary synchronisation to ensure that packet processing is complete before we stop and reset the FEC. 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>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 124d3c5f8046..0186fec1f7f9 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1530,7 +1530,11 @@ static void fec_enet_adjust_link(struct net_device *ndev)
}
} else {
if (fep->link) {
+ napi_disable(&fep->napi);
+ netif_tx_lock_bh(ndev);
fec_stop(ndev);
+ netif_tx_unlock_bh(ndev);
+ napi_enable(&fep->napi);
fep->link = phy_dev->link;
status_change = 1;
}