Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180588
b: refs/heads/master
c: 3f2e8d9
h: refs/heads/master
v: v3
  • Loading branch information
Simon Kagstrom authored and David S. Miller committed Feb 10, 2010
1 parent a97b442 commit 0626098
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39c2ff43ea3830ccc693f965abdace96e514b1c5
refs/heads/master: 3f2e8d9f13246382fbda6f03178eef867a9bfbe2
21 changes: 10 additions & 11 deletions trunk/drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -2148,16 +2148,9 @@ static int velocity_poll(struct napi_struct *napi, int budget)
struct velocity_info *vptr = container_of(napi,
struct velocity_info, napi);
unsigned int rx_done;
u32 isr_status;

spin_lock(&vptr->lock);
isr_status = mac_read_isr(vptr->mac_regs);

/* Ack the interrupt */
mac_write_isr(vptr->mac_regs, isr_status);
if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
velocity_error(vptr, isr_status);
unsigned long flags;

spin_lock_irqsave(&vptr->lock, flags);
/*
* Do rx and tx twice for performance (taken from the VIA
* out-of-tree driver).
Expand All @@ -2167,13 +2160,12 @@ static int velocity_poll(struct napi_struct *napi, int budget)
rx_done += velocity_rx_srv(vptr, budget - rx_done);
velocity_tx_srv(vptr);

spin_unlock(&vptr->lock);

/* If budget not fully consumed, exit the polling mode */
if (rx_done < budget) {
napi_complete(napi);
mac_enable_int(vptr->mac_regs);
}
spin_unlock_irqrestore(&vptr->lock, flags);

return rx_done;
}
Expand Down Expand Up @@ -2203,10 +2195,17 @@ static irqreturn_t velocity_intr(int irq, void *dev_instance)
return IRQ_NONE;
}

/* Ack the interrupt */
mac_write_isr(vptr->mac_regs, isr_status);

if (likely(napi_schedule_prep(&vptr->napi))) {
mac_disable_int(vptr->mac_regs);
__napi_schedule(&vptr->napi);
}

if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
velocity_error(vptr, isr_status);

spin_unlock(&vptr->lock);

return IRQ_HANDLED;
Expand Down

0 comments on commit 0626098

Please sign in to comment.