aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2005-11-08 17:37:12 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-09 01:02:41 -0500
commitba5eec9c55ec4be99d21a6ea614003b65d7f37d7 (patch)
tree79070a6366a44bf37101f0dfa3ee73bbc1192120 /drivers
parentb9dcbb40f40d60c7e33a2b7ea858fcd27c35cc00 (diff)
[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')
-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)
909 istat &= imask; 909 istat &= imask;
910 if (istat) { 910 if (istat) {
911 handled = 1; 911 handled = 1;
912
913 if (unlikely(!netif_running(dev))) {
914 printk(KERN_INFO "%s: late interrupt.\n", dev->name);
915 goto irq_ack;
916 }
917
912 if (netif_rx_schedule_prep(dev)) { 918 if (netif_rx_schedule_prep(dev)) {
913 /* NOTE: These writes are posted by the readback of 919 /* NOTE: These writes are posted by the readback of
914 * the ISTAT register below. 920 * the ISTAT register below.
@@ -921,6 +927,7 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
921 dev->name); 927 dev->name);
922 } 928 }
923 929
930irq_ack:
924 bw32(bp, B44_ISTAT, istat); 931 bw32(bp, B44_ISTAT, istat);
925 br32(bp, B44_ISTAT); 932 br32(bp, B44_ISTAT);
926 } 933 }
@@ -1446,6 +1453,8 @@ static int b44_close(struct net_device *dev)
1446 1453
1447 netif_stop_queue(dev); 1454 netif_stop_queue(dev);
1448 1455
1456 netif_poll_disable(dev);
1457
1449 del_timer_sync(&bp->timer); 1458 del_timer_sync(&bp->timer);
1450 1459
1451 spin_lock_irq(&bp->lock); 1460 spin_lock_irq(&bp->lock);
@@ -1461,6 +1470,8 @@ static int b44_close(struct net_device *dev)
1461 1470
1462 free_irq(dev->irq, dev); 1471 free_irq(dev->irq, dev);
1463 1472
1473 netif_poll_enable(dev);
1474
1464 b44_free_consistent(bp); 1475 b44_free_consistent(bp);
1465 1476
1466 return 0; 1477 return 0;