summaryrefslogtreecommitdiffstats
path: root/drivers/net/b44.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2005-11-08 23:37:12 +0100
committerJeff Garzik <jgarzik@pobox.com>2005-11-09 07:02:41 +0100
commitba5eec9c55ec4be99d21a6ea614003b65d7f37d7 (patch)
tree79070a6366a44bf37101f0dfa3ee73bbc1192120 /drivers/net/b44.c
parent[PATCH] b44: replace B44_FLAG_INIT_COMPLETE with netif_running() (diff)
downloadlinux-ba5eec9c55ec4be99d21a6ea614003b65d7f37d7.tar.xz
linux-ba5eec9c55ec4be99d21a6ea614003b65d7f37d7.zip
[PATCH] b44: race on device closing
Usual fix: - b44_interrupt() does not schedule NAPI polling when the device is going down; - b44_close() waits for any scheduled NAPI polling before it starts to release the private structures of the device. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/b44.c')
-rw-r--r--drivers/net/b44.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index f1675dcf4d5c..e829beea668c 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -909,6 +909,12 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
istat &= imask;
if (istat) {
handled = 1;
+
+ if (unlikely(!netif_running(dev))) {
+ printk(KERN_INFO "%s: late interrupt.\n", dev->name);
+ goto irq_ack;
+ }
+
if (netif_rx_schedule_prep(dev)) {
/* NOTE: These writes are posted by the readback of
* the ISTAT register below.
@@ -921,6 +927,7 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
dev->name);
}
+irq_ack:
bw32(bp, B44_ISTAT, istat);
br32(bp, B44_ISTAT);
}
@@ -1446,6 +1453,8 @@ static int b44_close(struct net_device *dev)
netif_stop_queue(dev);
+ netif_poll_disable(dev);
+
del_timer_sync(&bp->timer);
spin_lock_irq(&bp->lock);
@@ -1461,6 +1470,8 @@ static int b44_close(struct net_device *dev)
free_irq(dev->irq, dev);
+ netif_poll_enable(dev);
+
b44_free_consistent(bp);
return 0;