diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-02-22 13:28:33 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2006-02-23 17:07:07 -0500 |
commit | a9cdab869ec343ccc601484fb535813e16c25f70 (patch) | |
tree | 64d12d8befe316c1e7ef1254612b84acfc8024d4 /drivers/net | |
parent | 61a4dcc2f9b5c6861e7198b80dd73dd6e9247b7b (diff) |
skge: NAPI/irq race fix
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/skge.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 67fb19b8fde9..869c7cfb99a4 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -2678,8 +2678,7 @@ static int skge_poll(struct net_device *dev, int *budget) | |||
2678 | 2678 | ||
2679 | /* restart receiver */ | 2679 | /* restart receiver */ |
2680 | wmb(); | 2680 | wmb(); |
2681 | skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), | 2681 | skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START); |
2682 | CSR_START | CSR_IRQ_CL_F); | ||
2683 | 2682 | ||
2684 | *budget -= work_done; | 2683 | *budget -= work_done; |
2685 | dev->quota -= work_done; | 2684 | dev->quota -= work_done; |
@@ -2856,14 +2855,6 @@ static void skge_extirq(unsigned long data) | |||
2856 | local_irq_enable(); | 2855 | local_irq_enable(); |
2857 | } | 2856 | } |
2858 | 2857 | ||
2859 | static inline void skge_wakeup(struct net_device *dev) | ||
2860 | { | ||
2861 | struct skge_port *skge = netdev_priv(dev); | ||
2862 | |||
2863 | prefetch(skge->rx_ring.to_clean); | ||
2864 | netif_rx_schedule(dev); | ||
2865 | } | ||
2866 | |||
2867 | static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) | 2858 | static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) |
2868 | { | 2859 | { |
2869 | struct skge_hw *hw = dev_id; | 2860 | struct skge_hw *hw = dev_id; |
@@ -2874,13 +2865,15 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
2874 | 2865 | ||
2875 | status &= hw->intr_mask; | 2866 | status &= hw->intr_mask; |
2876 | if (status & IS_R1_F) { | 2867 | if (status & IS_R1_F) { |
2868 | skge_write8(hw, Q_ADDR(Q_R1, Q_CSR), CSR_IRQ_CL_F); | ||
2877 | hw->intr_mask &= ~IS_R1_F; | 2869 | hw->intr_mask &= ~IS_R1_F; |
2878 | skge_wakeup(hw->dev[0]); | 2870 | netif_rx_schedule(hw->dev[0]); |
2879 | } | 2871 | } |
2880 | 2872 | ||
2881 | if (status & IS_R2_F) { | 2873 | if (status & IS_R2_F) { |
2874 | skge_write8(hw, Q_ADDR(Q_R2, Q_CSR), CSR_IRQ_CL_F); | ||
2882 | hw->intr_mask &= ~IS_R2_F; | 2875 | hw->intr_mask &= ~IS_R2_F; |
2883 | skge_wakeup(hw->dev[1]); | 2876 | netif_rx_schedule(hw->dev[1]); |
2884 | } | 2877 | } |
2885 | 2878 | ||
2886 | if (status & IS_XA1_F) | 2879 | if (status & IS_XA1_F) |