linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Remi Machet <rmachet@slac.stanford.edu>
To: Scott Wood <scottwood@freescale.com>
Cc: Linux PPC <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] dma: add new dma_mapping_ops API sync_page
Date: Mon, 06 Oct 2008 10:38:52 -0700	[thread overview]
Message-ID: <1223314733.21869.38.camel@pcds-ts102.slac.stanford.edu> (raw)
In-Reply-To: <48EA3D0C.1050107@freescale.com>

On Mon, 2008-10-06 at 11:30 -0500, Scott Wood wrote:
> Remi Machet wrote:
> > After continuing to work on the dma noncoherent code I realized that
> > sync_page is not the best choice of API: 
> > -The API should preferably take a dma_addr_t in my opinion
> 
> A virtual address will typically be needed to perform the flush; why 
> pass the bus address?
Because it is a sync API. You want to make sure that a physical memory
area is in sync with the caches, not the virtual address. This
distinction can become important in the event where the page is mapped
multiple times in the memory and the architecture does not take care of
synchronizing the multiple mapping, the dma_mapping_ops code should be
able to synchronize the multiple mapping. In most case it would be easy
of course to go from virtual address to the page address, but not if the
page is in high memory ...

By the way I realized later on that scatter/gather structures contain 2
fields: dma_addr and dma_length that can be used to recover the bus
address => no need for sync_sg anymore.

Remi

  reply	other threads:[~2008-10-06 17:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 22:03 [PATCH] dma: add new dma_mapping_ops API sync_page Remi Machet
2008-10-03 16:33 ` Remi Machet
2008-10-06 16:30   ` Scott Wood
2008-10-06 17:38     ` Remi Machet [this message]
2008-10-10  3:46       ` Benjamin Herrenschmidt
2008-10-10 16:16         ` Remi Machet

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=1223314733.21869.38.camel@pcds-ts102.slac.stanford.edu \
    --to=rmachet@slac.stanford.edu \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.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 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).