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 <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Alan Cox and committed by David S. Miller 401da6ae 7ce97d4f

+8 -2
+8 -2
drivers/net/e100.c
··· 166 166 #include <linux/ethtool.h> 167 167 #include <linux/string.h> 168 168 #include <linux/firmware.h> 169 + #include <linux/rtnetlink.h> 169 170 #include <asm/unaligned.h> 170 171 171 172 ··· 2266 2265 2267 2266 DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n", 2268 2267 ioread8(&nic->csr->scb.status)); 2269 - e100_down(netdev_priv(netdev)); 2270 - e100_up(netdev_priv(netdev)); 2268 + 2269 + rtnl_lock(); 2270 + if (netif_running(netdev)) { 2271 + e100_down(netdev_priv(netdev)); 2272 + e100_up(netdev_priv(netdev)); 2273 + } 2274 + rtnl_unlock(); 2271 2275 } 2272 2276 2273 2277 static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode)