[Linux-stm32] [PATCH net] net: stmmac: Sync RX Buffer upon allocation
David Miller
davem at davemloft.net
Tue Jul 30 17:26:38 UTC 2019
From: Jose Abreu <Jose.Abreu at synopsys.com>
Date: Tue, 30 Jul 2019 15:57:16 +0200
> With recent changes that introduced support for Page Pool in stmmac, Jon
> reported that NFS boot was no longer working on an ARM64 based platform
> that had the IP behind an IOMMU.
>
> As Page Pool API does not guarantee DMA syncing because of the use of
> DMA_ATTR_SKIP_CPU_SYNC flag, we have to explicit sync the whole buffer upon
> re-allocation because we are always re-using same pages.
>
> In fact, ARM64 code invalidates the DMA area upon two situations [1]:
> - sync_single_for_cpu(): Invalidates if direction != DMA_TO_DEVICE
> - sync_single_for_device(): Invalidates if direction == DMA_FROM_DEVICE
>
> So, as we must invalidate both the current RX buffer and the newly allocated
> buffer we propose this fix.
>
> [1] arch/arm64/mm/cache.S
>
> Reported-by: Jon Hunter <jonathanh at nvidia.com>
> Tested-by: Jon Hunter <jonathanh at nvidia.com>
> Fixes: 2af6106ae949 ("net: stmmac: Introducing support for Page Pool")
> Signed-off-by: Jose Abreu <joabreu at synopsys.com>
Applied.
More information about the Linux-stm32
mailing list