diff options
author | Marin Mitov <mitov@issp.bas.bg> | 2008-03-23 04:20:09 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-25 23:42:06 -0400 |
commit | 6ef2977d414cc196baba0fb53509c5f8cd9154b4 (patch) | |
tree | 5cff016cfe15fcf79c169d6fa105093ee8972539 | |
parent | 9f5e60dd5ffca938da4cabc197af8b9405b5512e (diff) |
skge napi->poll() locking bug
According to: Documentation/networking/netdevices.txt:
<cite>
napi->poll:
..........
Context: softirq
will be called with interrupts disabled by netconsole.
</cite>
napi->poll() could be called either with interrupts enabled
(in softirq context) or disabled (by netconsole), so the irq flag
should be preserved.
Inspired by Ingo's resent forcedeth patch :-)
Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/skge.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 186eb8ebfda6..ae52cba75f9a 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -3199,12 +3199,14 @@ static int skge_poll(struct napi_struct *napi, int to_do) | |||
3199 | skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START); | 3199 | skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START); |
3200 | 3200 | ||
3201 | if (work_done < to_do) { | 3201 | if (work_done < to_do) { |
3202 | spin_lock_irq(&hw->hw_lock); | 3202 | unsigned long flags; |
3203 | |||
3204 | spin_lock_irqsave(&hw->hw_lock, flags); | ||
3203 | __netif_rx_complete(dev, napi); | 3205 | __netif_rx_complete(dev, napi); |
3204 | hw->intr_mask |= napimask[skge->port]; | 3206 | hw->intr_mask |= napimask[skge->port]; |
3205 | skge_write32(hw, B0_IMSK, hw->intr_mask); | 3207 | skge_write32(hw, B0_IMSK, hw->intr_mask); |
3206 | skge_read32(hw, B0_IMSK); | 3208 | skge_read32(hw, B0_IMSK); |
3207 | spin_unlock_irq(&hw->hw_lock); | 3209 | spin_unlock_irqrestore(&hw->hw_lock, flags); |
3208 | } | 3210 | } |
3209 | 3211 | ||
3210 | return work_done; | 3212 | return work_done; |