Skip to content

Commit

Permalink
net: macb: Re-enable RX interrupt only when RX is done
Browse files Browse the repository at this point in the history
When data is received during the driver processing received data the
NAPI is re-scheduled. In that case the RX interrupt should not be
re-enabled.

Signed-off-by: Soren Brinkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
sorenb-xlnx authored and davem330 committed May 5, 2014
1 parent 6a027b7 commit 02f7a34
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/net/ethernet/cadence/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,16 +891,15 @@ static int macb_poll(struct napi_struct *napi, int budget)
if (work_done < budget) {
napi_complete(napi);

/*
* We've done what we can to clean the buffers. Make sure we
* get notified when new packets arrive.
*/
macb_writel(bp, IER, MACB_RX_INT_FLAGS);

/* Packets received while interrupts were disabled */
status = macb_readl(bp, RSR);
if (unlikely(status))
if (unlikely(status)) {
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
macb_writel(bp, ISR, MACB_BIT(RCOMP));
napi_reschedule(napi);
} else {
macb_writel(bp, IER, MACB_RX_INT_FLAGS);
}
}

/* TODO: Handle errors */
Expand Down

0 comments on commit 02f7a34

Please sign in to comment.