From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: akepner@sgi.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
grundler@parisc-linux.org, jbarnes@virtuousgeek.org, jes@sgi.com,
randy.dunlap@oracle.com, rdreier@cisco.com,
James.Bottomley@steeleye.com, davem@davemloft.net,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] dma: passing "attributes" to dma_map_* routines
Date: Tue, 18 Dec 2007 21:59:24 +0100 [thread overview]
Message-ID: <476834AC.9050401@s5r6.in-berlin.de> (raw)
In-Reply-To: <20071218200759.GE412@sgi.com>
akepner@sgi.com wrote:
> Reorderings are possible on reads and
> writes. Things get synced up by either an interrupt or a write to
> a memory region with a "barrier attribute". Memory allocated with
> dma_alloc_coherent() gets the barrier attribute. The idea here is
> to allow memory allocated with plain old malloc() or whatever to
> get the same attribute.
>From its purpose it sounds like you need this only for few special
memory regions which would typically be mapped by dma_map_single() and
furthermore that drivers who need this behavior will be changed to
explicitly demand it. If so, a nonintrusive API extension could simply
be to add an
dma_addr_t dma_map_single_write_last(struct device *dev, void *ptr,
size_t size, enum dma_data_direction direction);
or however you'd like to call it. (DMA-maps a memory area for which it
is guaranteed that of all DMA writes pending at any time, a DMA
reordering interconnect --- if such an interconnect is present --- will
perform DMAs to other areas first and to this area last. On machines
which don't reorder DMAs, this function is the same as dma_map_single().)
However, your older patch series looks like you want this behavior also
in areas which are mapped by dma_map_sg(), do you?. Still, adding two
functions of the kind like above, if necessary, might still be
preferable to changing the call parameters of existing functions or to
overloading enum dma_data_direction.
So that would be option 3) of yours, though without your attrs
parameter. Do you expect the need for even more flags for other kinds
of special behavior?
--
Stefan Richter
-=====-=-=== ==-- =--=-
http://arcgraph.de/sr/
next prev parent reply other threads:[~2007-12-18 21:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 0:17 akepner
2007-12-18 16:50 ` Stefan Richter
2007-12-18 19:04 ` Roland Dreier
2007-12-18 20:07 ` akepner
2007-12-18 20:59 ` Stefan Richter [this message]
2007-12-18 21:09 ` Roland Dreier
2007-12-20 18:51 ` akepner
2007-12-20 19:06 ` akepner
2007-12-20 20:56 ` Benjamin Herrenschmidt
2007-12-21 18:00 ` akepner
2007-12-21 20:24 ` Stefan Richter
2007-12-21 21:31 ` Benjamin Herrenschmidt
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=476834AC.9050401@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=James.Bottomley@steeleye.com \
--cc=akepner@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=grundler@parisc-linux.org \
--cc=jbarnes@virtuousgeek.org \
--cc=jes@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
--cc=rdreier@cisco.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
Powered by JetHome