All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
To: netdev@vger.kernel.org
Subject: [PATCH  kernel 2.6.33-git11] lib8390: use spin_lock_irqsave for locking
Date: Sun, 7 Mar 2010 07:02:56 +0900	[thread overview]
Message-ID: <20100307070256.cb86716d.ken_kawasaki@spring.nifty.jp> (raw)
In-Reply-To: <20091213094411.18be2ff6.ken_kawasaki@spring.nifty.jp>


lib8390:
 use "spin_lock_irqsave", "local_irq_save" instead of "disable_irq".

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>

---

--- linux-2.6.33-git11/drivers/net/lib8390.c.orig	2010-03-06 20:09:28.000000000 +0900
+++ linux-2.6.33-git11/drivers/net/lib8390.c	2010-03-07 06:42:47.000000000 +0900
@@ -279,15 +279,13 @@ static void __ei_tx_timeout(struct net_d
 
 	/* Ugly but a reset can be slow, yet must be protected */
 
-	disable_irq_nosync_lockdep(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);
 	__NS8390_init(dev, 1);
 
-	spin_unlock(&ei_local->page_lock);
-	enable_irq_lockdep(dev->irq);
+	spin_unlock_irqrestore(&ei_local->page_lock, flags);
 	netif_wake_queue(dev);
 }
 
@@ -323,17 +321,11 @@ static netdev_tx_t __ei_start_xmit(struc
 
 	spin_lock_irqsave(&ei_local->page_lock, flags);
 	ei_outb_p(0x00, e8390_base + EN0_IMR);
-	spin_unlock_irqrestore(&ei_local->page_lock, flags);
-
 
 	/*
 	 *	Slow phase with lock held.
 	 */
 
-	disable_irq_nosync_lockdep_irqsave(dev->irq, &flags);
-
-	spin_lock(&ei_local->page_lock);
-
 	ei_local->irqlock = 1;
 
 	/*
@@ -368,8 +360,7 @@ static netdev_tx_t __ei_start_xmit(struc
 		ei_local->irqlock = 0;
 		netif_stop_queue(dev);
 		ei_outb_p(ENISR_ALL, e8390_base + EN0_IMR);
-		spin_unlock(&ei_local->page_lock);
-		enable_irq_lockdep_irqrestore(dev->irq, &flags);
+		spin_unlock_irqrestore(&ei_local->page_lock, flags);
 		dev->stats.tx_errors++;
 		return NETDEV_TX_BUSY;
 	}
@@ -409,8 +400,7 @@ static netdev_tx_t __ei_start_xmit(struc
 	ei_local->irqlock = 0;
 	ei_outb_p(ENISR_ALL, e8390_base + EN0_IMR);
 
-	spin_unlock(&ei_local->page_lock);
-	enable_irq_lockdep_irqrestore(dev->irq, &flags);
+	spin_unlock_irqrestore(&ei_local->page_lock, flags);
 
 	dev_kfree_skb (skb);
 	dev->stats.tx_bytes += send_length;
@@ -526,9 +516,11 @@ static irqreturn_t __ei_interrupt(int ir
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void __ei_poll(struct net_device *dev)
 {
-	disable_irq(dev->irq);
+	unsigned long flags;
+
+	local_irq_save(flags);
 	__ei_interrupt(dev->irq, dev);
-	enable_irq(dev->irq);
+	local_irq_restore(flags);
 }
 #endif
 

  parent reply	other threads:[~2010-03-06 22:03 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-05  0:49 [PATCH] axnet_cs: fix phy_id detection for bogus Asix chip Ken Kawasaki
2009-04-07  0:42 ` David Miller
2009-04-18 23:44 ` [PATCH] pcnet_cs: add cis(firmware) of the Allied Telesis LA-PCM Ken Kawasaki
2009-04-26  7:29   ` [PATCH] 3c589_cs: add cis(firmware) of 3Com multifunction pcmcia card Ken Kawasaki
2009-04-26 13:33     ` Ben Hutchings
2009-04-27 12:48       ` Ken Kawasaki
2009-09-12 22:22     ` [PATCH] pcnet_cs: add cis of Linksys " Ken Kawasaki
2009-09-21  4:10       ` [PATCH kernel 2.6.31-git9] 3c574_cs: spin_lock the set_multicast_list function Ken Kawasaki
2009-09-13  8:22     ` [PATCH kernel 2.6.31] pcnet_cs: add cis of Linksys multifunction pcmcia card Ken Kawasaki
2009-09-15  9:42       ` David Miller
2009-10-03 22:32       ` [PATCH kernel 2.6.32-rc1] pcnet_cs: add cis of National Semicondoctor's " Ken Kawasaki
2009-10-05  7:40         ` David Miller
2009-10-11 12:12         ` [PATCH kernel 2.6.32-rc3] 3c574_cs: spin_lock the set_multicast_list function Ken Kawasaki
2009-10-13  7:33           ` David Miller
2009-10-18  1:39         ` [PATCH kernel 2.6.32-rc5] pcnet_cs: add cis of PreMax PE-200 ethernet pcmcia card Ken Kawasaki
2009-10-21 19:18           ` Dan Williams
2009-10-22 11:10             ` Ken Kawasaki
2009-10-24 20:33               ` Ben Hutchings
2009-10-30  5:51           ` David Miller
2009-12-21 11:58         ` [PATCH kernel 2.6.33-rc1] pcnet_cs: add cis of KTI PE520 pcmcia network card Ken Kawasaki
2009-12-23  2:50           ` Ben Hutchings
2009-12-23  8:05           ` Ken Kawasaki
2010-01-04  5:42             ` David Miller
2009-12-23  8:10           ` [PATCH kernel 2.6.33-rc1 updated] " Ken Kawasaki
2009-12-29  1:17             ` [PATCH kernel 2.6.33-rc2] axnet_cs: remove unnecessary spin_unlock_irqrestore Ken Kawasaki
2010-01-04  5:52               ` David Miller
2010-01-04 11:34             ` [PATCH kernel 2.6.33-rc1 v3] pcnet_cs: add cis of KTI PE520 pcmcia network card Ken Kawasaki
2010-01-07  4:38               ` David Miller
2010-01-22 21:56             ` [PATCH kernel 2.6.33-rc5] fmvj18x_cs: add new id (Panasonic lan & modem card) Ken Kawasaki
2010-02-27 23:34               ` [PATCH kernel 2.6.33] axnet_cs: add new id Ken Kawasaki
2010-02-28  9:03                 ` David Miller
2010-03-27 20:55                 ` [PATCH kernel 2.6.34-rc2] pcnet_cs: " Ken Kawasaki
2010-03-27 23:56                   ` David Miller
2010-04-03 21:14                   ` [PATCH kernel 2.6.34-rc3] smc91c92_cs: fix the problem of "Unable to find hardware address" Ken Kawasaki
2010-04-03 22:07                     ` David Miller
2010-04-10 22:50                     ` [PATCH kernel 2.6.34-rc3-git9] smc91c92_cs: define multicast_table as unsigned char Ken Kawasaki
2010-04-13 10:09                       ` David Miller
2010-04-24 20:37                       ` [PATCH kernel 2.6.34-rc5] smc91c92_cs: spin_unlock_irqrestore before calling smc_interrupt() Ken Kawasaki
2010-04-27 21:47                         ` David Miller
2010-06-12 10:17                 ` [PATCH kernel 2.6.35-rc2] pcnet_cs: add new id (TOSHIBA Modem/LAN Card) Ken Kawasaki
2010-06-17  1:11                   ` David Miller
2010-06-20  1:24                   ` [PATCH kernel 2.6.35-rc3] smc91c92_cs: fix the problem that lan & modem does not work simultaneously Ken Kawasaki
2010-06-26  4:32                     ` David Miller
2010-07-06 11:22                     ` [PATCH kernel 2.6.35-rc3-git7] axnet_cs: local_irq_save before calling ei_irq_wrapper Ken Kawasaki
2010-07-07 21:51                       ` David Miller
2010-07-10 11:18                       ` [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt Ken Kawasaki
2010-07-11  2:46                         ` Ben Hutchings
2010-07-11  2:49                           ` David Miller
2010-07-11  3:12                             ` Ben Hutchings
2010-07-13  3:08                               ` David Miller
2010-08-28 22:45                         ` [PATCH kernel 2.6.36-rc2] pcnet_cs: add new_id Ken Kawasaki
2010-08-28 23:07                           ` David Miller
2010-10-29 22:17                           ` [PATCH kernel 2.6.36-git10] " Ken Kawasaki
2010-10-30 23:49                             ` David Miller
2010-11-06 15:11                             ` [PATCH kernel 2.6.37-rc1] axnet_cs: fix resume problem for some Ax88790 chip Ken Kawasaki
2010-11-12 22:01                               ` David Miller
2010-11-13 23:42                               ` [PATCH kernel 2.6.37-rc1]ipg.c: remove id [SUNDANCE, 0x1021] Ken Kawasaki
2010-11-18 18:45                                 ` David Miller
2010-12-13 12:27                                 ` [PATCH kernel 2.6.37-rc5] axnet_cs: move id (0x1bf, 0x2328) to axnet_cs Ken Kawasaki
2010-12-16 20:39                                   ` David Miller
2011-01-11 11:55                             ` [PATCH kernel 2.6.37] pcnet_cs: add new_id Ken Kawasaki
2011-01-11 22:04                               ` David Miller
2011-01-30 21:16                               ` [PATCH kernel 2.6.38rc2-git7] axnet_cs: reduce delay time at ei_rx_overrun Ken Kawasaki
2011-02-01  4:53                                 ` David Miller
2011-02-20 15:07                                 ` [PATCH kernel 2.6.38-rc5] fmvj18x_cs: add new id Ken Kawasaki
2011-02-28 20:06                                   ` David Miller
2011-06-04 23:20                                   ` [PATCH kernel 3.0-rc1] smc91c92_cs: set smc->base to NULL before iounmap Ken Kawasaki
2011-06-05 21:38                                     ` David Miller
2011-06-07 12:01                                     ` Ken Kawasaki
2009-12-13  0:44       ` [PATCH kernel 2.6.32-git7] 3c574_cs: disable irq before calling el3_interrupt Ken Kawasaki
2009-12-14  3:48         ` David Miller
2010-03-06 22:02         ` Ken Kawasaki [this message]
2010-05-03 10:43           ` [PATCH kernel 2.6.34-rc5] lib8390: to be SMP safe Ken Kawasaki
2010-05-06 20:47             ` Ken Kawasaki
2009-04-27 12:50   ` [PATCH] 3c589_cs: add cis(firmware) of 3Com multifunction pcmcia card Ken Kawasaki
2009-05-02  2:22     ` David Miller
2009-06-28  0:09 ` [PATCH] pcnet_cs: add new id (RIOS System PC CARD3 ETHERNET) Ken Kawasaki
2009-06-30 14:19   ` [PATCH] pcnet_cs: add new id David Miller
2009-07-05  8:34     ` Ken Kawasaki
2009-07-05  0:17 ` Ken Kawasaki
2009-07-06  2:02   ` David Miller
2009-07-05  0:19 ` [PATCH] pcnet_cs: add odd location support for write_asic function Ken Kawasaki
2009-07-08 12:09 ` Ken Kawasaki
2009-07-08 17:38   ` David Miller
2009-07-11  0:02 ` Ken Kawasaki
2009-07-11  3:26   ` David Miller
2009-07-11 22:15     ` Ken Kawasaki
2009-07-19 23:08 ` [PATCH] 3c589_cs: re-initialize the multicast in the tc589_reset Ken Kawasaki
2009-07-20 15:29   ` David Miller
2009-07-22 12:23     ` Ken Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100307070256.cb86716d.ken_kawasaki@spring.nifty.jp \
    --to=ken_kawasaki@spring.nifty.jp \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.