diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/via-velocity.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 54bafdab1f9d..317aa34b21cf 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -2148,16 +2148,9 @@ static int velocity_poll(struct napi_struct *napi, int budget) | |||
2148 | struct velocity_info *vptr = container_of(napi, | 2148 | struct velocity_info *vptr = container_of(napi, |
2149 | struct velocity_info, napi); | 2149 | struct velocity_info, napi); |
2150 | unsigned int rx_done; | 2150 | unsigned int rx_done; |
2151 | u32 isr_status; | 2151 | unsigned long flags; |
2152 | |||
2153 | spin_lock(&vptr->lock); | ||
2154 | isr_status = mac_read_isr(vptr->mac_regs); | ||
2155 | |||
2156 | /* Ack the interrupt */ | ||
2157 | mac_write_isr(vptr->mac_regs, isr_status); | ||
2158 | if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI))) | ||
2159 | velocity_error(vptr, isr_status); | ||
2160 | 2152 | ||
2153 | spin_lock_irqsave(&vptr->lock, flags); | ||
2161 | /* | 2154 | /* |
2162 | * Do rx and tx twice for performance (taken from the VIA | 2155 | * Do rx and tx twice for performance (taken from the VIA |
2163 | * out-of-tree driver). | 2156 | * out-of-tree driver). |
@@ -2167,13 +2160,12 @@ static int velocity_poll(struct napi_struct *napi, int budget) | |||
2167 | rx_done += velocity_rx_srv(vptr, budget - rx_done); | 2160 | rx_done += velocity_rx_srv(vptr, budget - rx_done); |
2168 | velocity_tx_srv(vptr); | 2161 | velocity_tx_srv(vptr); |
2169 | 2162 | ||
2170 | spin_unlock(&vptr->lock); | ||
2171 | |||
2172 | /* If budget not fully consumed, exit the polling mode */ | 2163 | /* If budget not fully consumed, exit the polling mode */ |
2173 | if (rx_done < budget) { | 2164 | if (rx_done < budget) { |
2174 | napi_complete(napi); | 2165 | napi_complete(napi); |
2175 | mac_enable_int(vptr->mac_regs); | 2166 | mac_enable_int(vptr->mac_regs); |
2176 | } | 2167 | } |
2168 | spin_unlock_irqrestore(&vptr->lock, flags); | ||
2177 | 2169 | ||
2178 | return rx_done; | 2170 | return rx_done; |
2179 | } | 2171 | } |
@@ -2203,10 +2195,17 @@ static irqreturn_t velocity_intr(int irq, void *dev_instance) | |||
2203 | return IRQ_NONE; | 2195 | return IRQ_NONE; |
2204 | } | 2196 | } |
2205 | 2197 | ||
2198 | /* Ack the interrupt */ | ||
2199 | mac_write_isr(vptr->mac_regs, isr_status); | ||
2200 | |||
2206 | if (likely(napi_schedule_prep(&vptr->napi))) { | 2201 | if (likely(napi_schedule_prep(&vptr->napi))) { |
2207 | mac_disable_int(vptr->mac_regs); | 2202 | mac_disable_int(vptr->mac_regs); |
2208 | __napi_schedule(&vptr->napi); | 2203 | __napi_schedule(&vptr->napi); |
2209 | } | 2204 | } |
2205 | |||
2206 | if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI))) | ||
2207 | velocity_error(vptr, isr_status); | ||
2208 | |||
2210 | spin_unlock(&vptr->lock); | 2209 | spin_unlock(&vptr->lock); |
2211 | 2210 | ||
2212 | return IRQ_HANDLED; | 2211 | return IRQ_HANDLED; |