[Q] comedi: vmap of the async->prealloc_buf

Dan Carpenter dan.carpenter at oracle.com
Fri Dec 21 07:01:16 UTC 2012

On Thu, Dec 20, 2012 at 10:36:39PM +0000, Ian Abbott wrote:
> On 20/12/12 17:09, H Hartley Sweeten wrote:
> >Hello all,
> >
> >I have a question...
> >
> >In the comedi core, the asynchronous 'prealloc_buf' is vmap'ed after
> >the page list has been allocated. The code in question looks like this:
> >
> >			async->prealloc_buf =
> >				vmap(pages, n_pages, VM_MAP, PAGE_KERNEL_NOCACHE);
> >#else
> >				vmap(pages, n_pages, VM_MAP, PAGE_KERNEL);
> >#endif
> >
> >Is the #ifdef something left over from an older kernel?
> >
> >Isn't PAGE_KERNEL_NOCACHE always defined?
> Unfortunately not; it's arch dependent.  Neither ARM nor PowerPC
> define it, for example.

Power PC has _PAGE_NO_CACHE and the DRM subsystem uses that like
PAGE_KERNEL_NOCACHE.  For example PAGE_AGP is define in one of these

#define PAGE_AGP __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE)  <- only on powerpc

I don't really know what's going on here though...

comedia and AGP are the only drivers which use PAGE_KERNEL_NOCACHE.

dan carpenter

More information about the devel mailing list