Hi, Thanks Marek for fixing this.
On Thu, Dec 19, 2024 at 12:02 PM Marek Vasut <[email protected]> wrote: > > TFTP transfers of large files, for example 128 MiB, can sporadically > get stuck and the transfer slows down considerably. > > This happens because the TX DMA descriptor in DRAM becomes out of sync > with the view of the TX DMA descriptor content from the CPU side, which > is viewed through the CPU caches. In order to guarantee these two views > are consistent, the cache over TX DMA descriptor that has possibly been > written by the rswitch hardware must first be invalidated, only then can > the descriptor be cleared and updated by the CPU, and finally the cache > over that area must be flushed back into DRAM to make sure the rswitch > hardware has consistent view of the updated descriptor content. > > The very first invalidation operation was missing, which led to sporadic > corruption of the TX DMA descriptor. Fix it, add the missing invalidation > operation. > > Reported-by: Enric Balletbo i Serra <[email protected]> > Signed-off-by: Marek Vasut <[email protected]> I did a stress test with one S4 Spider board tftp'ing a big image for more than 1 hour without getting stuck, before this patch this test didn't succeed, so Tested-by: Enric Balletbo i Serra <[email protected]> > --- > Cc: Joe Hershberger <[email protected]> > Cc: Nobuhiro Iwamatsu <[email protected]> > Cc: Ramon Fried <[email protected]> > Cc: Tom Rini <[email protected]> > Cc: [email protected] > --- > drivers/net/rswitch.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/rswitch.c b/drivers/net/rswitch.c > index 91e2c7b7845..259d584ac98 100644 > --- a/drivers/net/rswitch.c > +++ b/drivers/net/rswitch.c > @@ -836,6 +836,7 @@ static int rswitch_send(struct udevice *dev, void > *packet, int len) > > /* Update TX descriptor */ > rswitch_flush_dcache((uintptr_t)packet, len); > + rswitch_invalidate_dcache((uintptr_t)desc, sizeof(*desc)); > memset(desc, 0x0, sizeof(*desc)); > desc->die_dt = DT_FSINGLE; > desc->info_ds = len; > -- > 2.45.2 >

