[PATCH 2/3] net cpsw: fix rx stability under heavy network load

chf.fritz at googlemail.com chf.fritz at googlemail.com
Wed Apr 30 01:32:02 PDT 2014


From: Christoph Fritz <chf.fritz at googlemail.com>

RX DMA Head Descriptor Pointer can get 0 when there is a lot of traffic,
which results in a timeout error. A good way to provoke this error is by
sending lots of ARP requests. This patch makes sure that the RX DMA Head
Descriptor Pointer is set.

The origin driver, from which this is derived, already contains this fix.

Signed-off-by: Christoph Fritz <chf.fritz at googlemail.com>
---
 drivers/net/cpsw.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 52adf50..ec3263d 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -741,8 +741,13 @@ static int cpdma_process(struct cpsw_priv *priv, struct cpdma_chan *chan,
 	if (buffer)
 		*buffer = (void *)readl(&desc->sw_buffer);
 
-	if (status & CPDMA_DESC_OWNER)
+	if (status & CPDMA_DESC_OWNER) {
+		if (readl(chan->hdp) == 0) {
+			if (readl(&desc->hw_mode) & CPDMA_DESC_OWNER)
+				writel((u32)desc, chan->hdp);
+		}
 		return -EBUSY;
+	}
 
 	chan->head = (void *)readl(&desc->hw_next);
 
-- 
1.7.10.4




More information about the barebox mailing list