aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bfin_mac.c
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2009-05-28 23:40:43 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-29 18:49:08 -0400
commit805a8ab3ce1be83e9a98c21a625ebbb549a2d317 (patch)
treea52e5273d1e1ba281695808186fddfa07436722c /drivers/net/bfin_mac.c
parent91a455f089810625eb94a36ccc40ae963f451b06 (diff)
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 <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bfin_mac.c')
-rw-r--r--drivers/net/bfin_mac.c6
1 files changed, 6 insertions, 0 deletions
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,
688 } 688 }
689 } 689 }
690 690
691 /* make sure the internal data buffers in the core are drained
692 * so that the DMA descriptors are completely written when the
693 * DMA engine goes to fetch them below
694 */
695 SSYNC();
696
691 /* enable this packet's dma */ 697 /* enable this packet's dma */
692 current_tx_ptr->desc_a.config |= DMAEN; 698 current_tx_ptr->desc_a.config |= DMAEN;
693 699