aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2013-02-12 11:08:48 +0100
committerDavid S. Miller <davem@davemloft.net>2013-02-13 13:34:10 -0500
commit8770e91aa61127f82eb8a9e641832474dbbcc8f1 (patch)
tree65aa9243d2f96562261e01d2278eb4aae7be84ca
parentac574804d412047e52de4dd887615cc88f58aeb0 (diff)
downloadkernel_goldelico_gta04-8770e91aa61127f82eb8a9e641832474dbbcc8f1.zip
kernel_goldelico_gta04-8770e91aa61127f82eb8a9e641832474dbbcc8f1.tar.gz
kernel_goldelico_gta04-8770e91aa61127f82eb8a9e641832474dbbcc8f1.tar.bz2
net/macb: fix race with RX interrupt while doing NAPI
When interrupts are disabled, an RX condition can occur but it is not reported when enabling interrupts again. We need to check RSR and use napi_reschedule() if condition is met. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cadence/macb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index a9b0830..b9d4bb9 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -693,6 +693,11 @@ static int macb_poll(struct napi_struct *napi, int budget)
* 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))
+ napi_reschedule(napi);
}
/* TODO: Handle errors */