All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Woestenberg <leon.woestenberg@gmail.com>
To: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: driver mmap implementation for memory allocated with pci_alloc_consistent()?
Date: Thu, 19 May 2011 03:34:55 +0200	[thread overview]
Message-ID: <BANLkTik2UvgpsW-y_gZki_06KGGss+XABA@mail.gmail.com> (raw)
In-Reply-To: <1305767957.2375.117.camel@sli10-conroe>

Hello,

On Thu, May 19, 2011 at 3:19 AM, Shaohua Li <shaohua.li@intel.com> wrote:
> On Wed, 2011-05-18 at 21:02 +0800, Leon Woestenberg wrote:
> why use pci_alloc_consistent? you can allocate pages and mmap it to
> userspace. when you want to do dma, you can use pci_map_page to get dma
> address for the pages and do whatever.
>
Thanks for thinking along.

I need contiguous memory in this case.  But yes, I have just found out
that __get_free_pages() with pci_map_single()  does work with my
mmap() fault() handler.
See my other thread with the code posted.

I just want to understand how this would work with
pci_alloc_consistent(), as that is the generic interface for PCI
drivers.

Note that the latter provides consistent / coherent mapping, whereas
pci_map_single() does not in general.   On x86 it probably is the same
due to bus-snooping (right?).

Regards,
--
Leon

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2011-05-19  1:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTimo=yXTrgjQHn9746oNdj97Fb-Y9Q@mail.gmail.com>
     [not found] ` <20110518144129.GB4296@dumpdata.com>
2011-05-18 15:03   ` driver mmap implementation for memory allocated with pci_alloc_consistent()? Leon Woestenberg
2011-05-18 15:40     ` Konrad Rzeszutek Wilk
2011-05-18 19:35       ` Leon Woestenberg
2011-05-18 22:59         ` Leon Woestenberg
     [not found] ` <1305767957.2375.117.camel@sli10-conroe>
2011-05-19  1:34   ` Leon Woestenberg [this message]

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=BANLkTik2UvgpsW-y_gZki_06KGGss+XABA@mail.gmail.com \
    --to=leon.woestenberg@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=linux-pci@vger.kernel.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.