[PATCH] e100: Synchronize interface link state with poll routine
authorMalli Chilakala <mallikarjuna.chilakala@intel.com>
Fri, 29 Apr 2005 02:17:42 +0000 (19:17 -0700)
committerJeff Garzik <jgarzik@pobox.com>
Fri, 13 May 2005 00:59:28 +0000 (20:59 -0400)
Synchronize interface link state with e100 poll routine

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
drivers/net/e100.c

index 2c8c14ebf2058e5dedf45437432f1306e9f58c80..c1ca2dae7c4851bb48b2704462cd567dac69801c 100644 (file)
@@ -1743,8 +1743,11 @@ static int e100_up(struct nic *nic)
        if((err = request_irq(nic->pdev->irq, e100_intr, SA_SHIRQ,
                nic->netdev->name, nic->netdev)))
                goto err_no_irq;
-       e100_enable_irq(nic);
        netif_wake_queue(nic->netdev);
+       netif_poll_enable(nic->netdev);
+       /* enable ints _after_ enabling poll, preventing a race between
+        * disable ints+schedule */
+       e100_enable_irq(nic);
        return 0;
 
 err_no_irq:
@@ -1758,11 +1761,13 @@ err_rx_clean_list:
 
 static void e100_down(struct nic *nic)
 {
+       /* wait here for poll to complete */
+       netif_poll_disable(nic->netdev);
+       netif_stop_queue(nic->netdev);
        e100_hw_reset(nic);
        free_irq(nic->pdev->irq, nic->netdev);
        del_timer_sync(&nic->watchdog);
        netif_carrier_off(nic->netdev);
-       netif_stop_queue(nic->netdev);
        e100_clean_cbs(nic);
        e100_rx_clean_list(nic);
 }