On Wed, Sep 30, 2020 at 06:45:02PM +0200, Paul Cercueil wrote: >> We don't have such a thing in the Linux API at all. > > dma_pgprot(dev, vma->vm_page_prot, DMA_ATTR_NON_CONSISTENT); > > That was giving me non-coherent cached memory, and now I don't have an > alternative. Looking at Linux 5.9-rc dma_pgprot is defined as: pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs) { if (force_dma_unencrypted(dev)) prot = pgprot_decrypted(prot); if (dev_is_dma_coherent(dev) || (IS_ENABLED(CONFIG_DMA_NONCOHERENT_CACHE_SYNC) && (attrs & DMA_ATTR_NON_CONSISTENT))) return prot; #ifdef CONFIG_ARCH_HAS_DMA_WRITE_COMBINE if (attrs & DMA_ATTR_WRITE_COMBINE) return pgprot_writecombine(prot); #endif return pgprot_dmacoherent(prot); } so it doesn't change vma->vm_page_prot at all. The only place that uses _CACHE_CACHABLE_NONCOHERENT is the MIPS specific kmap_noncoherent which ha sa single caller that doesn't leak anywhere into driver code.