diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-05-29 18:07:31 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-30 09:52:48 -0400 |
commit | 47313054352b879a2bc65379d55b05f48a0af7ec (patch) | |
tree | f9876f1cd9891232ac4814b6c08145d1f3050178 /drivers/net/e1000 | |
parent | 8a32352661cc8e942897d205ba18f871ef7be597 (diff) |
e1000: restore netif_poll_enable call but make sure IRQs are off
This restores the previously removed netif_poll_enable call in e1000_open.
It's needed on all but the first call to e1000_open for a NIC as
e1000_close always calls netif_poll_disable.
netif_poll_enable can only be called safely if no polls have been
scheduled. This should be the case as long as we don't enter our IRQ
handler.
In order to guarantee this we explicitly disable IRQs as early as possible
when we're probing the NIC.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Kok, Auke" <auke-jan.h.kok@intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index cbc7febe9cdc..9ec35b7a8207 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -1325,7 +1325,10 @@ e1000_sw_init(struct e1000_adapter *adapter) | |||
1325 | spin_lock_init(&adapter->tx_queue_lock); | 1325 | spin_lock_init(&adapter->tx_queue_lock); |
1326 | #endif | 1326 | #endif |
1327 | 1327 | ||
1328 | atomic_set(&adapter->irq_sem, 1); | 1328 | /* Explicitly disable IRQ since the NIC can be in any state. */ |
1329 | atomic_set(&adapter->irq_sem, 0); | ||
1330 | e1000_irq_disable(adapter); | ||
1331 | |||
1329 | spin_lock_init(&adapter->stats_lock); | 1332 | spin_lock_init(&adapter->stats_lock); |
1330 | 1333 | ||
1331 | set_bit(__E1000_DOWN, &adapter->flags); | 1334 | set_bit(__E1000_DOWN, &adapter->flags); |
@@ -1431,6 +1434,10 @@ e1000_open(struct net_device *netdev) | |||
1431 | /* From here on the code is the same as e1000_up() */ | 1434 | /* From here on the code is the same as e1000_up() */ |
1432 | clear_bit(__E1000_DOWN, &adapter->flags); | 1435 | clear_bit(__E1000_DOWN, &adapter->flags); |
1433 | 1436 | ||
1437 | #ifdef CONFIG_E1000_NAPI | ||
1438 | netif_poll_enable(netdev); | ||
1439 | #endif | ||
1440 | |||
1434 | e1000_irq_enable(adapter); | 1441 | e1000_irq_enable(adapter); |
1435 | 1442 | ||
1436 | /* fire a link status change interrupt to start the watchdog */ | 1443 | /* fire a link status change interrupt to start the watchdog */ |