linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: Leon Woestenberg <leon.woestenberg@gmail.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	linux-pci@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: mmap() implementation for pci_alloc_consistent() memory?
Date: Fri, 20 May 2011 10:17:06 +0200	[thread overview]
Message-ID: <s5htycp6b25.wl%tiwai@suse.de> (raw)
In-Reply-To: <4DD60F57.8030000@ladisch.de>

At Fri, 20 May 2011 08:51:03 +0200,
Clemens Ladisch wrote:
> 
> Leon Woestenberg wrote:
> > On Thu, May 19, 2011 at 5:58 PM, Clemens Ladisch <clemens@ladisch.de> wrote:
> >>> On Thu, May 19, 2011 at 12:14:40AM +0200, Leon Woestenberg wrote:
> >>> >     vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> >>
> >> So is this an architecture without coherent caches?
> > 
> > My aim is to have an architecture independent driver.
> 
> Please note that most MMU architectures forbid mapping the same memory
> with different attributes, so you must use pgprot_noncached if and only
> if dma_alloc_coherent actually uses it.  Something like the code below.
> 
> And I'm not sure if you have to do some additional cache flushes when
> mapping on some architectures.
> 
> >> Or would you want to use pgprot_dmacoherent, if available?
> > 
> > Hmm, let me check that.
> 
> It's available only on ARM and Unicore32.
> 
> There's also dma_mmap_coherent(), which does exactly what you want if
> your buffer is physically contiguous, but it's ARM only.
> Takashi tried to implement it for other architectures; I don't know
> what came of it.

PPC got this recently (thanks to Ben), but still missing in other
areas.

There was little uncertain issue on MIPS, and it looks difficult to
achieve it on PA-RISC at all.  The development was stuck due to lack
of time since then.


Takashi

--
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>

  reply	other threads:[~2011-05-20  8:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 22:14 Leon Woestenberg
2011-05-19  1:04 ` Leon Woestenberg
2011-05-19 14:59 ` Konrad Rzeszutek Wilk
2011-05-19 15:58   ` Clemens Ladisch
2011-05-19 22:10     ` Leon Woestenberg
2011-05-20  6:51       ` Clemens Ladisch
2011-05-20  8:17         ` Takashi Iwai [this message]
2011-05-21 10:59           ` Leon Woestenberg
2011-05-23  8:30             ` Clemens Ladisch
2011-05-24 14:18               ` Leon Woestenberg

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=s5htycp6b25.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=clemens@ladisch.de \
    --cc=konrad.wilk@oracle.com \
    --cc=leon.woestenberg@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox