LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Grant Grundler <grundler@parisc-linux.org>
Cc: Michael Ellerman <michael@ellerman.id.au>,
akepner@sgi.com, Tony Luck <tony.luck@intel.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Jes Sorensen <jes@sgi.com>,
Randy Dunlap <randy.dunlap@oracle.com>,
Roland Dreier <rdreier@cisco.com>,
David Miller <davem@davemloft.net>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3 v3] dma: document dma_{un}map_{single|sg}_attrs() interface
Date: Fri, 29 Feb 2008 12:37:56 -0600 [thread overview]
Message-ID: <1204310276.4003.48.camel@localhost.localdomain> (raw)
In-Reply-To: <20080229182504.GA18102@colo.lackof.org>
On Fri, 2008-02-29 at 11:25 -0700, Grant Grundler wrote:
> On Fri, Feb 29, 2008 at 01:45:46PM +1100, Michael Ellerman wrote:
> > On Thu, Feb 28, 2008 at 2:24 PM, <akepner@sgi.com> wrote:
> > >
> > > Document the new dma_{un}map_{single|sg}_attrs() functions.
> > >
> > > diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt
> > > index e69de29..36baea5 100644
> > > --- a/Documentation/DMA-attributes.txt
> > > +++ b/Documentation/DMA-attributes.txt
> > > @@ -0,0 +1,29 @@
> > > + DMA attributes
> > > + ==============
> > > +
> > > +This document describes the semantics of the DMA attributes that are
> > > +defined in linux/dma-attrs.h.
> > > +
> > > +
> > > +DMA_ATTR_SYNC_ON_WRITE
> > > +----------------------
> > > +
> > > +DMA_ATTR_SYNC_ON_WRITE is used on the IA64_SGI_SN2 architecture.
> > > +It provides a mechanism for devices to explicitly order their DMA
> > > +writes.
> > > +
> > > +On IA64_SGI_SN2 machines, DMA may be reordered within the NUMA
> > > +interconnect. Allowing reordering improves performance, but in some
> > > +situations it may be necessary to ensure that one DMA write is
> > > +complete before another is visible. For example, if the device does
> > > +a DMA write to indicate that data is available in memory, DMA of the
> > > +"completion indication" can race with DMA of data.
> > > +
> > > +When a memory region is mapped with the DMA_ATTR_SYNC_ON_WRITE attribute,
> > > +a write to that region causes all in-flight DMA to be flushed to memory.
> > > +Any pending DMA will complete and be visible in memory before the write
> > > +to the region with the DMA_ATTR_SYNC_ON_WRITE attribute becomes visible.
> >
> >
> > I'm not clear how this is all meant to work. Your intial patch says
> > this is an interface to pass "architecture-specific
> > attributes" from drivers through to the DMA mapping code, which is
> > fair enough - we want to do something similar.
> >
> > But it's not clear that DMA_ATTR_SYNC_ON_WRITE is architecture
> > specific. If I was a driver writer might assume it works on all
> > platforms.
>
> That would be a fair assumption. But it is required to be a NOP on
> platforms that don't need the "hint" ("attr" or whatever you want
> to call it). Specific architectures (SN2 in this case) will need
> to implement something.
To be honest, I still don't like the name. SYNC_ON_WRITE is the SN2
implementation. What it's actually doing is implementing strict
ordering semantics. I think it should really be
DMA_ATTR_STRICT_ORDERING (with a corresponding
DMA_ATTR_RELAXED_ORDERING).
This means that if ever anyone sets a PCIe bridge to relaxed ordering by
default, this attribute will also work for them.
James
next prev parent reply other threads:[~2008-02-29 18:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-28 3:24 akepner
2008-02-29 2:45 ` Michael Ellerman
2008-02-29 18:25 ` Grant Grundler
2008-02-29 18:37 ` James Bottomley [this message]
2008-03-01 2:56 ` Benjamin Herrenschmidt
2008-03-01 3:11 ` Jesse Barnes
2008-03-01 7:18 ` Grant Grundler
2008-03-05 18:13 ` akepner
2008-03-05 19:02 ` Jesse Barnes
2008-03-06 6:01 ` Michael Ellerman
2008-03-12 1:19 ` akepner
2008-03-14 4:13 ` Grant Grundler
2008-03-14 4:30 ` Michael Ellerman
2008-03-14 5:21 ` Grant Grundler
2008-03-14 16:40 ` Jesse Barnes
2008-03-18 1:08 ` Michael Ellerman
2008-03-20 0:32 ` akepner
2008-02-29 21:23 ` akepner
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=1204310276.4003.48.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=akepner@sgi.com \
--cc=benh@kernel.crashing.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=michael@ellerman.id.au \
--cc=randy.dunlap@oracle.com \
--cc=rdreier@cisco.com \
--cc=tony.luck@intel.com \
--subject='Re: [PATCH 1/3 v3] dma: document dma_{un}map_{single|sg}_attrs() interface' \
/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
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).