public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: akepner@sgi.com
To: akpm@linux-foundation.org
Cc: Tony Luck <tony.luck@intel.com>,
	Grant Grundler <grundler@parisc-linux.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Jes Sorensen <jes@sgi.com>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	Roland Dreier <rdreier@cisco.com>,
	James Bottomley <James.Bottomley@steeleye.com>,
	David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] dma: add dma_flags_set/get_*() interfaces
Date: Tue, 16 Oct 2007 18:41:28 -0700	[thread overview]
Message-ID: <20071017014128.GJ5601@sgi.com> (raw)


Introduce the dma_flags_set/get_*() interfaces and give them 
default implementations. 

Architectures which allow DMA to be reordered between a device and 
host memory (within a NUMA interconnect) can redefine these to allow 
a driver to explicitly synchronize DMA from the device when necessary.

Signed-off-by: Arthur Kepner <akepner@sgi.com>

--- 

Andrew, this is the first in a series of three patches:

  [1/3] dma: add dma_flags_set/get_*() interfaces
  [2/3] dma: redefine dma_flags_set/get_*() for sn-ia64
  [3/3] dma: document dma_flags_set/get_*()

Variants of these patches have been discussed on several 
occasions, most recently in a thread beginning:

http://marc.info/?l=linux-kernel&m=119137949604365&w=2

Please consider this for 2.6.24.

Jes, Tony, please note that I added an explicit test for 
CONFIG_IA64_SGI_SN2 in asm-ia64/sn/io.h (Yuck). This is 
needed for IA64_GENERIC to build, since there's at least one 
driver (qla1280) that includes asm-ia64/sn/io.h for 
CONFIG_IA64_GENERIC. 

 dma-mapping.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 0ebfafb..132b559 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -106,4 +106,22 @@ static inline void dmam_release_declared_memory(struct device *dev)
 }
 #endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
 
+#define DMA_BARRIER_ATTR	0x1
+#ifndef ARCH_USES_DMA_ATTRS
+static inline int dma_flags_set_attr(u32 attr, enum dma_data_direction dir) 
+{
+	return dir;
+}
+
+static inline int dma_flags_get_dir(int flags)
+{
+	return flags;
+}
+
+static inline int dma_flags_get_attr(int flags)
+{
+	return 0;
+}
+#endif /* ARCH_USES_DMA_ATTRS */
+
 #endif

             reply	other threads:[~2007-10-17  1:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-17  1:41 akepner [this message]
2007-10-17  3:27 ` [PATCH 1/3] dma: add dma_flags_set/get_*() interfaces Andrew Morton
2007-10-17 16:03   ` akepner
2007-10-17 20:10     ` Andrew Morton

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=20071017014128.GJ5601@sgi.com \
    --to=akepner@sgi.com \
    --cc=James.Bottomley@steeleye.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 \
    --cc=tony.luck@intel.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