From: Matt Porter <mporter@kernel.crashing.org>
To: Sachin P <sachinpc@gmail.com>
Cc: Linuxppc-dev@ozlabs.org
Subject: Re: consistent_alloc() on PPC
Date: Thu, 20 Jan 2005 11:16:27 -0700 [thread overview]
Message-ID: <20050120111627.A5631@cox.net> (raw)
In-Reply-To: <66164fbc05012008302fe3e542@mail.gmail.com>; from sachinpc@gmail.com on Thu, Jan 20, 2005 at 10:00:47PM +0530
On Thu, Jan 20, 2005 at 10:00:47PM +0530, Sachin P wrote:
> Hi,
> Thanks a lot to all of you for the help .
> The following is a more clearer version of the problem I am facing :
>
> 1.I am porting drivers from X86 (running Linux 2.4-20) to
> PPC platform running (Montevista Linux-2.4.20).
> 2.In wrapper function for DMA allocation, I am using
> consistent_alloc() to allocate the memory. This function gives me
> both the virtual-address as well as the dma-address.
> I pass both these values to the upper-level drivers.
> 3. However , once the upper-level drivers are done with the memory
> they call the wrapper function for free dma and pass only the dma
> address and not the virtual-address. However consistent_free()
> accepts only virtual-address.
> Hence I need a way to convert the dma address to the
> virtual-address.
All you need to do is cache the virtual address and the dma/phys
address for later use when calling consistent_free(). converting
random DMA/phys to virtual is a bad idea since you are going to
find multiple mappings. Cache the results in your driver...it's
trivial.
-Matt
next prev parent reply other threads:[~2005-01-20 18:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-19 11:53 consistent_alloc() on PPC Sachin P
2005-01-19 14:04 ` Matt Porter
2005-01-19 14:10 ` Christoph Hellwig
2005-01-19 14:56 ` Matt Porter
2005-01-20 16:30 ` Sachin P
2005-01-20 18:16 ` Matt Porter [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-01-19 11:53 Sachin P
2005-01-19 15:14 ` Jörn Engel
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=20050120111627.A5631@cox.net \
--to=mporter@kernel.crashing.org \
--cc=Linuxppc-dev@ozlabs.org \
--cc=sachinpc@gmail.com \
/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.