]> err.no Git - linux-2.6/commitdiff
axnet_cs: use spin_lock_irqsave instead of spin_lock + disable_irq
authorKomuro <komurojun-mbn@nifty.com>
Sun, 11 Nov 2007 02:04:36 +0000 (11:04 +0900)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:04:14 +0000 (15:04 -0800)
Signed-off-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/pcmcia/axnet_cs.c

index 8d910a372f89ae9d5e64ce85791a17bbab0eba53..6d342f6c14f643a67a8ee6d78429a1480828f32f 100644 (file)
@@ -1040,15 +1040,13 @@ void ei_tx_timeout(struct net_device *dev)
 
        /* Ugly but a reset can be slow, yet must be protected */
                
-       disable_irq_nosync(dev->irq);
-       spin_lock(&ei_local->page_lock);
+       spin_lock_irqsave(&ei_local->page_lock, flags);
                
        /* Try to restart the card.  Perhaps the user has fixed something. */
        ei_reset_8390(dev);
        AX88190_init(dev, 1);
                
-       spin_unlock(&ei_local->page_lock);
-       enable_irq(dev->irq);
+       spin_unlock_irqrestore(&ei_local->page_lock, flags);
        netif_wake_queue(dev);
 }
     
@@ -1085,9 +1083,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
         *      Slow phase with lock held.
         */
         
-       disable_irq_nosync(dev->irq);
-       
-       spin_lock(&ei_local->page_lock);
+       spin_lock_irqsave(&ei_local->page_lock, flags);
        
        ei_local->irqlock = 1;
 
@@ -1125,8 +1121,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
                ei_local->irqlock = 0;
                netif_stop_queue(dev);
                outb_p(ENISR_ALL, e8390_base + EN0_IMR);
-               spin_unlock(&ei_local->page_lock);
-               enable_irq(dev->irq);
+               spin_unlock_irqrestore(&ei_local->page_lock, flags);
                ei_local->stat.tx_errors++;
                return 1;
        }
@@ -1172,8 +1167,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
        ei_local->irqlock = 0;
        outb_p(ENISR_ALL, e8390_base + EN0_IMR);
        
-       spin_unlock(&ei_local->page_lock);
-       enable_irq(dev->irq);
+       spin_unlock_irqrestore(&ei_local->page_lock, flags);
 
        dev_kfree_skb (skb);
        ei_local->stat.tx_bytes += send_length;