]> git.baikalelectronics.ru Git - kernel.git/commit
net: fec: quiesce packet processing before stopping device in fec_set_features()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 8 Jul 2014 11:40:28 +0000 (12:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jul 2014 03:02:59 +0000 (20:02 -0700)
commit7b30b1ca415047c7f7e5f5d1bbcb6cc2cebea99a
treec10d2d9cc5e2aab26c948a6ab62cd3b90fb0ba78
parentffec96094a558e5a477c5974a2046c5c9e4fe79d
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>
drivers/net/ethernet/freescale/fec_main.c