aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-02-22 13:52:33 -0800
committerChris Wright <chrisw@sous-sol.org>2006-03-01 14:36:37 -0800
commite501e04cf0b3cd2d89ebfd8ad6cd38e1a88a1a71 (patch)
tree5ac3b75cc5f5835502542a02fd192822107b7822
parent82a0d8860dfd709ce46dc2f0c3670b9f5c52da8a (diff)
[PATCH] skge: fix NAPI/irq race
Fix a race in the receive NAPI, irq handling. The interrupt clear and the start need to be separated. Otherwise there is a window between the last frame received and the NAPI done level handling. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r--drivers/net/skge.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 1255759211d..28905eeef80 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2675,8 +2675,7 @@ static int skge_poll(struct net_device *dev, int *budget)
/* restart receiver */
wmb();
- skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR),
- CSR_START | CSR_IRQ_CL_F);
+ skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START);
*budget -= work_done;
dev->quota -= work_done;
@@ -2853,14 +2852,6 @@ static void skge_extirq(unsigned long data)
local_irq_enable();
}
-static inline void skge_wakeup(struct net_device *dev)
-{
- struct skge_port *skge = netdev_priv(dev);
-
- prefetch(skge->rx_ring.to_clean);
- netif_rx_schedule(dev);
-}
-
static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs)
{
struct skge_hw *hw = dev_id;
@@ -2871,13 +2862,15 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs)
status &= hw->intr_mask;
if (status & IS_R1_F) {
+ skge_write8(hw, Q_ADDR(Q_R1, Q_CSR), CSR_IRQ_CL_F);
hw->intr_mask &= ~IS_R1_F;
- skge_wakeup(hw->dev[0]);
+ netif_rx_schedule(hw->dev[0]);
}
if (status & IS_R2_F) {
+ skge_write8(hw, Q_ADDR(Q_R2, Q_CSR), CSR_IRQ_CL_F);
hw->intr_mask &= ~IS_R2_F;
- skge_wakeup(hw->dev[1]);
+ netif_rx_schedule(hw->dev[1]);
}
if (status & IS_XA1_F)