From 805a8ab3ce1be83e9a98c21a625ebbb549a2d317 Mon Sep 17 00:00:00 2001 From: Sonic Zhang Date: Fri, 29 May 2009 03:40:43 +0000 Subject: [PATCH] netdev: bfin_mac: fix malformed UDP packet transmission when polling with KGDB Writes to the DMA descriptors may sit in the internal Blackfin data buffers and not actually be available when the DMA engine goes to fetch them. This does not typically happen, but when dealing with short/fast packets such as UDP and polling KGDB, this occurs much more frequently. Same goes for heavy loads as seen by netperf tests or large scp transfers. So force the buffers to drain with SSYNC otherwise we get random malformed packets. Signed-off-by: Sonic Zhang Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu Signed-off-by: David S. Miller --- drivers/net/bfin_mac.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index 1905532d0940..38d34cec65a3 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c @@ -688,6 +688,12 @@ static int bfin_mac_hard_start_xmit(struct sk_buff *skb, } } + /* make sure the internal data buffers in the core are drained + * so that the DMA descriptors are completely written when the + * DMA engine goes to fetch them below + */ + SSYNC(); + /* enable this packet's dma */ current_tx_ptr->desc_a.config |= DMAEN; -- 2.39.2