Skip to content

Commit

Permalink
e100: Fix the TX workqueue race
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and David S. Miller committed Apr 25, 2010
1 parent 7ce97d4 commit 401da6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/net/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
#include <linux/ethtool.h>
#include <linux/string.h>
#include <linux/firmware.h>
#include <linux/rtnetlink.h>
#include <asm/unaligned.h>


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

DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n",
ioread8(&nic->csr->scb.status));
e100_down(netdev_priv(netdev));
e100_up(netdev_priv(netdev));

rtnl_lock();
if (netif_running(netdev)) {
e100_down(netdev_priv(netdev));
e100_up(netdev_priv(netdev));
}
rtnl_unlock();
}

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

0 comments on commit 401da6a

Please sign in to comment.