linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@au1.ibm.com>
To: Bruce_Leonard@selinc.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: Trouble with DMA on PPC linux question
Date: Tue, 19 Apr 2016 18:45:40 +1000	[thread overview]
Message-ID: <1461055540.2801.10.camel@au1.ibm.com> (raw)
In-Reply-To: <OFDB971D2B.A484FAC0-ON88257F99.0075C134-88257F99.00786154@selinc.com>

On Mon, 2016-04-18 at 14:54 -0700, Bruce_Leonard@selinc.com wrote:
> 
> On the DMA transactions that work, the virtual address I hand to 
> dma_map_single() is something like 0xe0840000 and the dma_addr_t result is 
> 0x10840000 which is less than my 512Mb limit.  On the transactions that 
> don't work, the virtual address is 0xd5390000 with the mapped result being 
> 0x25390000, which is past my upper bound on my RAM.  In fact it's not even 
> in my memory map, there's a hole there. 

Where does this virtual address come from ?

The kernel has two types of virtual addresses. Those coming from the
linear mapping (the stuff you get from kmalloc() for example, or
get_pages()) which can be translated using that simple substraction.

The other is the vmalloc space, and that is a non-linear mapping of
random pages.

If your vaddr comes from the latter it can't be passed to
dma_map_single as-is, you need to get to the underlying pages first.

Ben.

  reply	other threads:[~2016-04-19  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 21:54 Trouble with DMA on PPC linux question Bruce_Leonard
2016-04-19  8:45 ` Benjamin Herrenschmidt [this message]
2016-04-19 17:11   ` Bruce_Leonard

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=1461055540.2801.10.camel@au1.ibm.com \
    --to=benh@au1.ibm.com \
    --cc=Bruce_Leonard@selinc.com \
    --cc=linuxppc-dev@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).