浏览代码

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>
Nicolas Ferre 12 年之前
父节点
当前提交
8770e91aa6
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      drivers/net/ethernet/cadence/macb.c

+ 5 - 0
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.
 		 * get notified when new packets arrive.
 		 */
 		 */
 		macb_writel(bp, IER, MACB_RX_INT_FLAGS);
 		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 */
 	/* TODO: Handle errors */