]> git.ipfire.org Git - thirdparty/u-boot.git/commit
dma: ti: k3-udma: invalidate prepared buffers before pushing to recv ring next
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Fri, 26 Apr 2024 08:02:28 +0000 (10:02 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 15 May 2024 16:46:47 +0000 (10:46 -0600)
commit1db973b65f9c1efbfa5370a95d6330f29557b3ab
treee962907193ca9889600627dd423801d8d8e90282
parente563593d6e3759519cb1b1493e67e032109c8cae
dma: ti: k3-udma: invalidate prepared buffers before pushing to recv ring

Buffers must not have an unclean cache before being used for DMA - a
pending write-back may corrupt the next dev-to-mem transfer otherwise.

This was consistently noticeable during long TFTP transfers, when an ARP
request is answered by U-Boot in the middle of the transfer:

As U-Boot's arp_receive() reuses the receive buffer to prepare its
reply packet, the beginning of one of the next incoming TFTP packets
is overwritten by the ARP reply. The corrupted packet is ignored, but
the TFTP transfer stalls for a few seconds until a timeout is detected
and a retransmit is triggered.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
drivers/dma/ti/k3-udma.c