Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-23 Thread Jakub Kicinski
On Sat, 21 May 2022 10:44:30 -0700 Jakub Kicinski wrote: > > Well, I say the contrary. > > > > On the mainline the patch may be applied as is, it won't harm. > > > > However, it is gets applied to kernel 4.9 (based on the fixes: tag), it > > will break the driver for at least powerpc 8xx. > >

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-21 Thread Jakub Kicinski
On Sat, 21 May 2022 06:44:41 + Christophe Leroy wrote: > > Hm, I think the patch is necessary, sorry if you're also saying that > > and I'm misinterpreting. > > Well, I say the contrary. > > On the mainline the patch may be applied as is, it won't harm. > > However, it is gets applied to k

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-20 Thread Christophe Leroy
Le 20/05/2022 à 19:43, Jakub Kicinski a écrit : > On Fri, 20 May 2022 12:54:56 + Christophe Leroy wrote: >> Le 20/05/2022 à 14:35, Måns Rullgård a écrit : >>> Christophe Leroy writes: See original commit 070e1f01827c. It explicitely says that the cache must be invalidate _AFTER_ th

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-20 Thread Jakub Kicinski
On Fri, 20 May 2022 12:54:56 + Christophe Leroy wrote: > Le 20/05/2022 à 14:35, Måns Rullgård a écrit : > > Christophe Leroy writes: > >> See original commit 070e1f01827c. It explicitely says that the cache > >> must be invalidate _AFTER_ the copy. > >> > >> The cache is initialy invalidated b

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-20 Thread Christophe Leroy
Le 20/05/2022 à 14:35, Måns Rullgård a écrit : > Christophe Leroy writes: > >> Le 19/05/2022 à 21:24, Mans Rullgard a écrit : >>> The dma_sync_single_for_cpu() call must precede reading the received >>> data. Fix this. >> >> See original commit 070e1f01827c. It explicitely says that the cache >

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-20 Thread Måns Rullgård
Christophe Leroy writes: > Le 19/05/2022 à 21:24, Mans Rullgard a écrit : >> The dma_sync_single_for_cpu() call must precede reading the received >> data. Fix this. > > See original commit 070e1f01827c. It explicitely says that the cache > must be invalidate _AFTER_ the copy. > > The cache is in

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-19 Thread Christophe Leroy
Le 19/05/2022 à 21:24, Mans Rullgard a écrit : > The dma_sync_single_for_cpu() call must precede reading the received > data. Fix this. See original commit 070e1f01827c. It explicitely says that the cache must be invalidate _AFTER_ the copy. The cache is initialy invalidated by dma_map_single(),

[PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-19 Thread Mans Rullgard
The dma_sync_single_for_cpu() call must precede reading the received data. Fix this. Fixes: 070e1f01827c ("net: fs_enet: don't unmap DMA when packet len is below copybreak") Signed-off-by: Mans Rullgard --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 8 1 file changed, 4 in