[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <IXCHHQ.XHZEBJ42HOEJ1@crapouillou.net>
Date: Wed, 30 Sep 2020 18:39:18 +0200
From: Paul Cercueil <paul@...pouillou.net>
To: Christoph Hellwig <hch@....de>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
Dave Airlie <airlied@...ux.ie>,
DRI <dri-devel@...ts.freedesktop.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: linux-next: build failure after merge of the drm tree
Le mer. 30 sept. 2020 à 18:11, Christoph Hellwig <hch@....de> a écrit
:
> On Wed, Sep 30, 2020 at 03:33:13PM +0200, Paul Cercueil wrote:
>> One thing missing for remap_pfn_range(), I have no alternative for
>> this:
>>
>> vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot,
>> DMA_ATTR_NON_CONSISTENT);
>>
>> So I have to do:
>>
>> vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
>> pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
>> pgprot_val(vma->vm_page_prot) |= _CACHE_CACHABLE_NONCOHERENT;
>>
>> And that will only compile on MIPS, because these _CACHE_* macros
>> are only
>> defined there.
>>
>> I would need something like a pgprot_noncoherent(), I think.
>
> dma_alloc_pages gives you cached memory, so you can't just use an
> uncached protection for the userspace mmap here. If you want uncached
> memory you need to use dma_alloc_coherent paired with
> dma_mmap_coherent.
> Or dma_alloc_wc for a slightly different flavor of uncached. (both
> of the map to dma_alloc_attrs / dma_mmap_attrs eventually).
I don't want uncached memory, I want non-coherent cached memory.
-Paul
Powered by blists - more mailing lists