Why dma_alloc_coherent don't return direct mapped vaddr?

Arnd Bergmann arnd at arndb.de
Tue Jul 26 23:40:34 PDT 2022


On Wed, Jul 27, 2022 at 5:02 AM Li Chen <me at linux.beauty> wrote:
>  ---- On Tue, 26 Jul 2022 15:50:57 +0900  Li Chen <me at linux.beauty> wrote ---
>
> It seems that SVA(Shared Virtual Addressing, https://lwn.net/Articles/747230/)
> is a perfect solution to do DMA operation from userspace and using userspace
> allocated memory,
>  but unfortunately, our SoC don't have SMMU and cannot operate on DSP's
> DMA engine directly from Linux driver

SVA assumes that the DMA master is cache coherent with your CPU, so even
if you could make the pagetable side work with an IOMMU here, you still get
incorrect data.

       Arnd



More information about the linux-arm-kernel mailing list