From: Michal Simek Date: Thu, 13 Dec 2018 14:40:20 +0100 Subject: [U-Boot] [PATCH] zynq-gem: Flush cache before handing RX packet to receive handler In-Reply-To: References: <22bfd13652dc41acb1e9d65f6cf61e1c@Neckar.pixel-group.local> Message-ID: <08b8f617-4ec9-dd9a-0c0f-de2b660fcf2b@monstr.eu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 13. 12. 18 14:37, Bin Meng wrote: > Hi Stefan, > > On Thu, Dec 13, 2018 at 9:26 PM Stefan Theil wrote: >> >> Hmm good question. I went with flush because that's what's done in the transmit function: >> >> addr = (ulong) ptr; >> addr &= ~(ARCH_DMA_MINALIGN - 1); >> size = roundup(len, ARCH_DMA_MINALIGN); >> flush_dcache_range(addr, addr + size); >> >> addr = (ulong)priv->rxbuffers; >> addr &= ~(ARCH_DMA_MINALIGN - 1); >> size = roundup((RX_BUF * PKTSIZE_ALIGN), ARCH_DMA_MINALIGN); >> flush_dcache_range(addr, addr + size); >> barrier(); >> >> But since we actually want the uncached data invalidation seems logical. I have to admit though, I don't have much experience with caches. This patch completely fixed my problem... Maybe somebody with a bit more expertise can add their opinion? > > It should be 'invalidate' primitive when it comes to the RX path. For > TX path, it should be 'flush'. +1 yes. Please retest with invalidate. Thanks, Michal -- Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: