Skip to content

Commit 401da6a

Browse files
Alan Coxdavem330
authored andcommitted
e100: Fix the TX workqueue race
Nothing stops the workqueue being left to run in parallel with close or a few other operations. This causes double unmaps and the like. See kerneloops.org #1041230 for an example Signed-off-by: Alan Cox <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7ce97d4 commit 401da6a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/net/e100.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
#include <linux/ethtool.h>
167167
#include <linux/string.h>
168168
#include <linux/firmware.h>
169+
#include <linux/rtnetlink.h>
169170
#include <asm/unaligned.h>
170171

171172

@@ -2265,8 +2266,13 @@ static void e100_tx_timeout_task(struct work_struct *work)
22652266

22662267
DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n",
22672268
ioread8(&nic->csr->scb.status));
2268-
e100_down(netdev_priv(netdev));
2269-
e100_up(netdev_priv(netdev));
2269+
2270+
rtnl_lock();
2271+
if (netif_running(netdev)) {
2272+
e100_down(netdev_priv(netdev));
2273+
e100_up(netdev_priv(netdev));
2274+
}
2275+
rtnl_unlock();
22702276
}
22712277

22722278
static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode)

0 commit comments

Comments
 (0)