login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
September
»
27
Re: [3/4] dma: document dma_flags_set_dmabarrier()
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Grant Grundler <grundler@...>
To: <akepner@...>
Cc: Grant Grundler <grundler@...>, Jesse Barnes <jbarnes@...>, Jes Sorensen <jes@...>, Randy Dunlap <randy.dunlap@...>, RolandDreier <rdreier@...>, James Bottomley <James.Bottomley@...>, <linux-kernel@...>
Subject:
Re: [3/4] dma: document dma_flags_set_dmabarrier()
Date: Thursday, September 27, 2007 - 11:33 pm
On Thu, Sep 27, 2007 at 06:13:02PM -0700,
akepner@sgi.com
wrote:
quoted text
> > Document dma_flags_set_dmabarrier(). > > Signed-off-by: Arthur Kepner <akepner@sgi.com>
This looks really good! thanks, grant Acked-by: Grant Grundler <grundler@parisc-linux.org>
quoted text
> > --- > DMA-API.txt | 26 ++++++++++++++++++++++++++ > 1 files changed, 26 insertions(+) > > diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt > index cc7a8c3..5fc0bba 100644 > --- a/Documentation/DMA-API.txt > +++ b/Documentation/DMA-API.txt > @@ -544,3 +544,29 @@ size is the size (and should be a page-sized multiple). > The return value will be either a pointer to the processor virtual > address of the memory, or an error (via PTR_ERR()) if any part of the > region is occupied. > + > +int > +dma_flags_set_dmabarrier(int dir) > + > +Amend dir (one of the enum dma_data_direction values), with a > +platform-specific "dmabarrier" attribute. The dmabarrier attribute > +forces a flush of all in-flight DMA when the associated memory > +region is written to (see example below.) > + > +This provides a mechanism to enforce ordering of DMA on platforms that > +permit DMA to be reordered between device and host memory (within a > +NUMA interconnect). On other platforms this is a nop. > + > +The dmabarrier would be set when the memory region is mapped for DMA, > +e.g.: > + > + int count, flags = dma_flags_set_dmabarrier(DMA_BIDIRECTIONAL); > + .... > + count = dma_map_sg(dev, sglist, nents, flags); > + > +As an example of a situation where this would be useful, suppose that > +the device does a DMA write to indicate that data is ready and > +available in memory. The DMA of the "completion indication" could > +race with data DMA. Using a dmabarrier on the memory used for > +completion indications would prevent the race. > +
-
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[3/4] dma: document dma_flags_set_dmabarrier()
,
, (Thu Sep 27, 9:13 pm)
Re: [3/4] dma: document dma_flags_set_dmabarrier()
, Grant Grundler
, (Thu Sep 27, 11:33 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Hiten Pandya
Re: up? (emacs docbook xml ide)
Andy Whitcroft
clam
Kamalesh Babulal
Re: 2.6.23-rc6-mm1
git
:
linux-netdev
:
Stephen Hemminger
Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
David Miller
[GIT]: Networking
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
10 users
and
869 guests
online.
Online users
buildersperthh
thetruthsixpac
redaask397
cordic
murphybedsayndm
nomorepanicrab
internetmarkban
sequestrationhe
playgolfucm
broce982
Syndicate