All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: PowerPC equivalent to dma_mmap_writecombine()?
Date: Fri, 06 Jul 2007 15:19:38 -0500	[thread overview]
Message-ID: <468EA3DA.8070903@freescale.com> (raw)
In-Reply-To: <200707051813.53762.arnd@arndb.de>

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

  parent reply	other threads:[~2007-07-06 20:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-05 16:41 PowerPC equivalent to dma_mmap_writecombine()? Timur Tabi
2007-07-05 16:13 ` Arnd Bergmann
2007-07-05 20:11   ` Segher Boessenkool
2007-07-06 20:19   ` Timur Tabi [this message]
2007-07-06 21:26     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=468EA3DA.8070903@freescale.com \
    --to=timur@freescale.com \
    --cc=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.