linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Remi Machet <rmachet@slac.stanford.edu>
To: Linux PPC <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] dma: add new dma_mapping_ops API sync_page
Date: Fri, 03 Oct 2008 09:33:13 -0700	[thread overview]
Message-ID: <1223051594.4251.12.camel@pcds-ts102.slac.stanford.edu> (raw)
In-Reply-To: <1222898599.8628.52.camel@pcds-ts102.slac.stanford.edu>

On Wed, 2008-10-01 at 15:03 -0700, Remi Machet wrote:
> This patch replaces the global APIs __dma_sync and __dma_sync_page
> with a new dma_mapping_ops API named sync_page. This is necessary to make
> sure that the proper synchronization mechanism is used for a device
> DMA depending on the bus the device is on.
> 

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
-Using sync_page forced me to create a new define in io.h: bus_to_page.

I now think it would be better to have 2 new API: sync (which takes a
dma_addr_t) and sync_sg (which takes a scatter/gather list). Adding
sync_sg would make us get rid of the last page_to_bus in the code (to
get the dma_addr_t from the scatter gather list entry sg I do:
page_to_bus(sg_page(sg))+sg->offset).

Any feedback is welcome on this issue. I hate adding 2 new APIs but they
would make it possible to have 2 completely different DMA architectures
supported in one kernel on the same hardware.

Remi

  reply	other threads:[~2008-10-03 16:33 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 [this message]
2008-10-06 16:30   ` Scott Wood
2008-10-06 17:38     ` Remi Machet
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=1223051594.4251.12.camel@pcds-ts102.slac.stanford.edu \
    --to=rmachet@slac.stanford.edu \
    --cc=linuxppc-dev@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).