Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730696 > unrolled thread

[PATCH V2 1/3] dma-mapping: Provide a default plat_device_is_coherent()

Started byHuacai Chen <chenhc@lemote.com>
First post2017-09-12 09:10 +0200
Last post2017-09-12 09:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH V2 1/3] dma-mapping: Provide a default plat_device_is_coherent() Huacai Chen <chenhc@lemote.com> - 2017-09-12 09:10 +0200

#1730696 — [PATCH V2 1/3] dma-mapping: Provide a default plat_device_is_coherent()

FromHuacai Chen <chenhc@lemote.com>
Date2017-09-12 09:10 +0200
Subject[PATCH V2 1/3] dma-mapping: Provide a default plat_device_is_coherent()
Message-ID<uoNuz-6Cp-33@gated-at.bofh.it>
We will use plat_device_is_coherent() in generic cases, but it is
MIPS-specific now. So we provide a default implementation.

Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
 arch/mips/include/asm/dma-mapping.h | 1 +
 include/linux/dma-mapping.h         | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index aba7138..662eca9 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -8,6 +8,7 @@
 #ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */
 #include <dma-coherence.h>
 #endif
+#define ARCH_HAS_PLAT_DEVICE_IS_COHERENT
 
 extern const struct dma_map_ops *mips_dma_map_ops;
 
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 2189c79..613a80e 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -710,6 +710,14 @@ static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
 }
 
 #ifdef CONFIG_HAS_DMA
+
+#ifndef ARCH_HAS_PLAT_DEVICE_IS_COHERENT
+static inline int plat_device_is_coherent(struct device *dev)
+{
+	return 1;
+}
+#endif
+
 static inline int dma_get_cache_alignment(void)
 {
 #ifdef ARCH_DMA_MINALIGN
-- 
2.7.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web