Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 805a8ab3 authored by Sonic Zhang's avatar Sonic Zhang Committed by David S. Miller
Browse files

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: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 91a455f0
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -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 */
	/* enable this packet's dma */
	current_tx_ptr->desc_a.config |= DMAEN;
	current_tx_ptr->desc_a.config |= DMAEN;