Thread (5 messages) flat view 5 messages, 3 authors, 2007-07-06

Re: PowerPC equivalent to dma_mmap_writecombine()?

From: Timur Tabi <hidden>
Date: 2007-07-06 20:19:47

Arnd Bergmann wrote:
Not sure exactly what arm does here, but it sounds like you want
to call remap_pfn_range with the _PAGE_NO_CACHE bit set in the
protection flags, and _PAGE_GUARDED not set.
I always have a hard time with these mapping functions.  Is this right?

vma->vm_page_prot = __pgprot((pgprot_val(vma->vm_page_prot) | _PAGE_NO_CACHE) & 
~_PAGE_GUARDED));

ret = remap_pfn_range(vma, vma->vm_start, runtime->dma_addr, runtime->dma_bytes, 
vma->vm_page_prot);

Alternatively, could I use function snd_pcm_lib_mmap_iomem() (sound/core/pcm_native.c)? 
It looks like it does the right thing, although it doesn't unset the guarded bit.  If 
that's wrong, I can submit a patch to unset that bit on PowerPC, but like I said, I can 
never quite get my head around this mapping stuff.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help