Skip to content

Commit 02f7a34

Browse files
sorenb-xlnxdavem330
authored andcommitted
net: macb: Re-enable RX interrupt only when RX is done
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]>
1 parent 6a027b7 commit 02f7a34

File tree

1 file changed

+6
-7
lines changed
  • drivers/net/ethernet/cadence

1 file changed

+6
-7
lines changed

drivers/net/ethernet/cadence/macb.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -891,16 +891,15 @@ static int macb_poll(struct napi_struct *napi, int budget)
891891
if (work_done < budget) {
892892
napi_complete(napi);
893893

894-
/*
895-
* We've done what we can to clean the buffers. Make sure we
896-
* get notified when new packets arrive.
897-
*/
898-
macb_writel(bp, IER, MACB_RX_INT_FLAGS);
899-
900894
/* Packets received while interrupts were disabled */
901895
status = macb_readl(bp, RSR);
902-
if (unlikely(status))
896+
if (unlikely(status)) {
897+
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
898+
macb_writel(bp, ISR, MACB_BIT(RCOMP));
903899
napi_reschedule(napi);
900+
} else {
901+
macb_writel(bp, IER, MACB_RX_INT_FLAGS);
902+
}
904903
}
905904

906905
/* TODO: Handle errors */

0 commit comments

Comments
 (0)