diff options
-rw-r--r-- | drivers/net/sky2.c | 20 | ||||
-rw-r--r-- | include/linux/netdevice.h | 18 |
2 files changed, 12 insertions, 26 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 227df9876a2c..76da74fbe859 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -2105,7 +2105,6 @@ static int sky2_poll(struct net_device *dev0, int *budget) | |||
2105 | int work_done = 0; | 2105 | int work_done = 0; |
2106 | u32 status = sky2_read32(hw, B0_Y2_SP_EISR); | 2106 | u32 status = sky2_read32(hw, B0_Y2_SP_EISR); |
2107 | 2107 | ||
2108 | restart_poll: | ||
2109 | if (unlikely(status & ~Y2_IS_STAT_BMU)) { | 2108 | if (unlikely(status & ~Y2_IS_STAT_BMU)) { |
2110 | if (status & Y2_IS_HW_ERR) | 2109 | if (status & Y2_IS_HW_ERR) |
2111 | sky2_hw_intr(hw); | 2110 | sky2_hw_intr(hw); |
@@ -2136,7 +2135,7 @@ static int sky2_poll(struct net_device *dev0, int *budget) | |||
2136 | } | 2135 | } |
2137 | 2136 | ||
2138 | if (status & Y2_IS_STAT_BMU) { | 2137 | if (status & Y2_IS_STAT_BMU) { |
2139 | work_done += sky2_status_intr(hw, work_limit - work_done); | 2138 | work_done = sky2_status_intr(hw, work_limit); |
2140 | *budget -= work_done; | 2139 | *budget -= work_done; |
2141 | dev0->quota -= work_done; | 2140 | dev0->quota -= work_done; |
2142 | 2141 | ||
@@ -2148,22 +2147,9 @@ static int sky2_poll(struct net_device *dev0, int *budget) | |||
2148 | 2147 | ||
2149 | mod_timer(&hw->idle_timer, jiffies + HZ); | 2148 | mod_timer(&hw->idle_timer, jiffies + HZ); |
2150 | 2149 | ||
2151 | local_irq_disable(); | 2150 | netif_rx_complete(dev0); |
2152 | __netif_rx_complete(dev0); | ||
2153 | 2151 | ||
2154 | status = sky2_read32(hw, B0_Y2_SP_LISR); | 2152 | status = sky2_read32(hw, B0_Y2_SP_LISR); |
2155 | |||
2156 | if (unlikely(status)) { | ||
2157 | /* More work pending, try and keep going */ | ||
2158 | if (__netif_rx_schedule_prep(dev0)) { | ||
2159 | __netif_rx_reschedule(dev0, work_done); | ||
2160 | status = sky2_read32(hw, B0_Y2_SP_EISR); | ||
2161 | local_irq_enable(); | ||
2162 | goto restart_poll; | ||
2163 | } | ||
2164 | } | ||
2165 | |||
2166 | local_irq_enable(); | ||
2167 | return 0; | 2153 | return 0; |
2168 | } | 2154 | } |
2169 | 2155 | ||
@@ -2181,6 +2167,8 @@ static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
2181 | prefetch(&hw->st_le[hw->st_idx]); | 2167 | prefetch(&hw->st_le[hw->st_idx]); |
2182 | if (likely(__netif_rx_schedule_prep(dev0))) | 2168 | if (likely(__netif_rx_schedule_prep(dev0))) |
2183 | __netif_rx_schedule(dev0); | 2169 | __netif_rx_schedule(dev0); |
2170 | else | ||
2171 | printk(KERN_DEBUG PFX "irq race detected\n"); | ||
2184 | 2172 | ||
2185 | return IRQ_HANDLED; | 2173 | return IRQ_HANDLED; |
2186 | } | 2174 | } |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 309f9190a922..a461b51d6076 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -831,21 +831,19 @@ static inline void netif_rx_schedule(struct net_device *dev) | |||
831 | __netif_rx_schedule(dev); | 831 | __netif_rx_schedule(dev); |
832 | } | 832 | } |
833 | 833 | ||
834 | 834 | /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). | |
835 | static inline void __netif_rx_reschedule(struct net_device *dev, int undo) | 835 | * Do not inline this? |
836 | { | 836 | */ |
837 | dev->quota += undo; | ||
838 | list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); | ||
839 | __raise_softirq_irqoff(NET_RX_SOFTIRQ); | ||
840 | } | ||
841 | |||
842 | /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */ | ||
843 | static inline int netif_rx_reschedule(struct net_device *dev, int undo) | 837 | static inline int netif_rx_reschedule(struct net_device *dev, int undo) |
844 | { | 838 | { |
845 | if (netif_rx_schedule_prep(dev)) { | 839 | if (netif_rx_schedule_prep(dev)) { |
846 | unsigned long flags; | 840 | unsigned long flags; |
841 | |||
842 | dev->quota += undo; | ||
843 | |||
847 | local_irq_save(flags); | 844 | local_irq_save(flags); |
848 | __netif_rx_reschedule(dev, undo); | 845 | list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); |
846 | __raise_softirq_irqoff(NET_RX_SOFTIRQ); | ||
849 | local_irq_restore(flags); | 847 | local_irq_restore(flags); |
850 | return 1; | 848 | return 1; |
851 | } | 849 | } |