From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org,
Greg KH <greg@kroah.com>
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, Francois Romieu <romieu@fr.zoreil.com>,
Jeff Garzik <jeff@garzik.org>
Subject: [patch 4/9] netpoll: drivers must not enable IRQ unconditionally in their NAPI handler
Date: Mon, 26 Feb 2007 16:06:26 -0800 [thread overview]
Message-ID: <20070227000626.GE6283@kroah.com> (raw)
In-Reply-To: <20070227000538.GA6283@kroah.com>
[-- Attachment #1: netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler.patch --]
[-- Type: text/plain, Size: 3737 bytes --]
-stable review patch. If anyone has any objections, please let us know.
------------------
From: Francois Romieu <romieu@fr.zoreil.com>
netpoll: drivers must not enable IRQ unconditionally in their NAPI handler
net/core/netpoll.c::netpoll_send_skb() calls the poll handler when
it is available. As netconsole can be used from almost any context,
IRQ must not be enabled blindly in the NAPI handler of a driver which
supports netpoll.
b57bd06655a028aba7b92e1c19c2093e7fcfb341 fixed the issue for the
8139too.c driver.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/8139cp.c | 6 ++++--
drivers/net/b44.c | 6 ++++--
drivers/net/forcedeth.c | 11 +++++++----
drivers/net/skge.c | 5 +++--
4 files changed, 18 insertions(+), 10 deletions(-)
--- linux-2.6.19.5.orig/drivers/net/8139cp.c
+++ linux-2.6.19.5/drivers/net/8139cp.c
@@ -617,13 +617,15 @@ rx_next:
* this round of polling
*/
if (rx_work) {
+ unsigned long flags;
+
if (cpr16(IntrStatus) & cp_rx_intr_mask)
goto rx_status_loop;
- local_irq_disable();
+ local_irq_save(flags);
cpw16_f(IntrMask, cp_intr_mask);
__netif_rx_complete(dev);
- local_irq_enable();
+ local_irq_restore(flags);
return 0; /* done */
}
--- linux-2.6.19.5.orig/drivers/net/b44.c
+++ linux-2.6.19.5/drivers/net/b44.c
@@ -879,12 +879,14 @@ static int b44_poll(struct net_device *n
}
if (bp->istat & ISTAT_ERRORS) {
- spin_lock_irq(&bp->lock);
+ unsigned long flags;
+
+ spin_lock_irqsave(&bp->lock, flags);
b44_halt(bp);
b44_init_rings(bp);
b44_init_hw(bp, 1);
netif_wake_queue(bp->dev);
- spin_unlock_irq(&bp->lock);
+ spin_unlock_irqrestore(&bp->lock, flags);
done = 1;
}
--- linux-2.6.19.5.orig/drivers/net/forcedeth.c
+++ linux-2.6.19.5/drivers/net/forcedeth.c
@@ -2544,14 +2544,15 @@ static int nv_napi_poll(struct net_devic
int pkts, limit = min(*budget, dev->quota);
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);
+ unsigned long flags;
pkts = nv_rx_process(dev, limit);
if (nv_alloc_rx(dev)) {
- spin_lock_irq(&np->lock);
+ spin_lock_irqsave(&np->lock, flags);
if (!np->in_shutdown)
mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
- spin_unlock_irq(&np->lock);
+ spin_unlock_irqrestore(&np->lock, flags);
}
if (pkts < limit) {
@@ -2559,13 +2560,15 @@ static int nv_napi_poll(struct net_devic
netif_rx_complete(dev);
/* re-enable receive interrupts */
- spin_lock_irq(&np->lock);
+ spin_lock_irqsave(&np->lock, flags);
+
np->irqmask |= NVREG_IRQ_RX_ALL;
if (np->msi_flags & NV_MSI_X_ENABLED)
writel(NVREG_IRQ_RX_ALL, base + NvRegIrqMask);
else
writel(np->irqmask, base + NvRegIrqMask);
- spin_unlock_irq(&np->lock);
+
+ spin_unlock_irqrestore(&np->lock, flags);
return 0;
} else {
/* used up our quantum, so reschedule */
--- linux-2.6.19.5.orig/drivers/net/skge.c
+++ linux-2.6.19.5/drivers/net/skge.c
@@ -2919,6 +2919,7 @@ static int skge_poll(struct net_device *
struct skge_hw *hw = skge->hw;
struct skge_ring *ring = &skge->rx_ring;
struct skge_element *e;
+ unsigned long flags;
int to_do = min(dev->quota, *budget);
int work_done = 0;
@@ -2956,12 +2957,12 @@ static int skge_poll(struct net_device *
if (work_done >= to_do)
return 1; /* not done */
- spin_lock_irq(&hw->hw_lock);
+ spin_lock_irqsave(&hw->hw_lock, flags);
__netif_rx_complete(dev);
hw->intr_mask |= irqmask[skge->port];
skge_write32(hw, B0_IMSK, hw->intr_mask);
skge_read32(hw, B0_IMSK);
- spin_unlock_irq(&hw->hw_lock);
+ spin_unlock_irqrestore(&hw->hw_lock, flags);
return 0;
}
--
next prev parent reply other threads:[~2007-02-27 0:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070226235248.438556696@mini.kroah.org>
2007-02-27 0:05 ` [patch 0/9] 2.6.19-stable review Greg KH
2007-02-27 0:06 ` [patch 1/9] fix umask when noACL kernel meets extN tuned for ACLs Greg KH
2007-02-27 0:28 ` Andreas Gruenbacher
2007-02-27 0:06 ` [patch 2/9] Backport of psmouse suspend/shutdown cleanups Greg KH
2007-02-27 0:06 ` [patch 3/9] fix memory corruption from misinterpreted bad_inode_ops return values (CVE-2006-5753) Greg KH
2007-02-27 0:06 ` Greg KH [this message]
2007-02-27 0:06 ` [patch 5/9] hda-intel - Dont try to probe invalid codecs Greg KH
2007-02-27 0:06 ` [patch 6/9] Fix oops when Windows server sent bad domain name null terminator Greg KH
2007-02-27 0:06 ` [patch 7/9] USB: usbnet driver bugfix Greg KH
2007-02-27 0:06 ` [patch 8/9] hda-codec - Dont return error at initialization of modem codec Greg KH
2007-02-27 0:06 ` [patch 9/9] Missing critical phys_to_virt in lib/swiotlb.c Greg KH
2007-02-27 2:47 ` [patch 0/9] 2.6.19-stable review (mmc: Power quirk for ENE controllers) Darren Salt
2007-02-27 20:23 ` [patch 0/9] 2.6.19-stable review Michael Krufky
2007-03-03 1:23 ` Greg KH
2007-03-03 1:48 ` Michael Krufky
2007-03-03 7:48 ` Greg KH
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=20070227000626.GE6283@kroah.com \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=greg@kroah.com \
--cc=jeff@garzik.org \
--cc=jmforbes@linuxtx.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkrufky@linuxtv.org \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=romieu@fr.zoreil.com \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=zwane@arm.linux.org.uk \
/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.