[PATCH 1/3] dma: add dma_flags_set/get_*() interfaces

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>
Cc: Tony Luck <tony.luck@...>, Grant Grundler <grundler@...>, Jesse Barnes <jbarnes@...>, Jes Sorensen <jes@...>, Randy Dunlap <randy.dunlap@...>, Roland Dreier <rdreier@...>, James Bottomley <James.Bottomley@...>, David Miller <davem@...>, <linux-kernel@...>
Date: Tuesday, October 16, 2007 - 9:41 pm

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
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/3] dma: add dma_flags_set/get_*() interfaces, , (Tue Oct 16, 9:41 pm)
Re: [PATCH 1/3] dma: add dma_flags_set/get_*() interfaces, Andrew Morton, (Tue Oct 16, 11:27 pm)
Re: [PATCH 1/3] dma: add dma_flags_set/get_*() interfaces, Andrew Morton, (Wed Oct 17, 4:10 pm)