From: Stefan Theil Date: Thu, 13 Dec 2018 13:41:29 +0000 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: <662bfa278c9948298c7d2798d643b19a@Neckar.pixel-group.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de > -----Urspr=C3=BCngliche Nachricht----- > Von: Bin Meng [mailto:bmeng.cn at gmail.com] > Gesendet: Donnerstag, 13. Dezember 2018 14:37 > An: Stefan Theil > Cc: U-Boot Mailing List > Betreff: Re: Re: [U-Boot] [PATCH] zynq-gem: Flush cache before handing RX > packet to receive handler >=20 > Hi Stefan, >=20 > On Thu, Dec 13, 2018 at 9:26 PM Stefan Theil mode.de> wrote: > > > > Hmm good question. I went with flush because that's what's done in the > transmit function: > > > > addr =3D (ulong) ptr; > > addr &=3D ~(ARCH_DMA_MINALIGN - 1); > > size =3D roundup(len, ARCH_DMA_MINALIGN); flush_dcache_range(addr, > addr > > + size); > > > > addr =3D (ulong)priv->rxbuffers; > > addr &=3D ~(ARCH_DMA_MINALIGN - 1); > > size =3D 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? >=20 > It should be 'invalidate' primitive when it comes to the RX path. For TX = path, it > should be 'flush'. >=20 > Regards, > Bin Then why are all receive buffers flushed before sending a packet? In any ca= se, I'll try it with invalidate and submit an updated version. Regards, Stefan