]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dma-mapping: add a Kconfig symbol to indicate arch_dma_prep_coherent presence
authorChristoph Hellwig <hch@lst.de>
Mon, 25 Mar 2019 14:44:06 +0000 (15:44 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 6 May 2019 13:04:40 +0000 (15:04 +0200)
Add a Kconfig symbol that indicates an architecture provides a
arch_dma_prep_coherent implementation, and provide a stub otherwise.

This will allow the generic dma-iommu code to use it while still
allowing to be built for cache coherent architectures.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
arch/arm64/Kconfig
arch/csky/Kconfig
include/linux/dma-noncoherent.h
kernel/dma/Kconfig

index 7e34b9eba5de151572ba479d73ccf82ba18e8beb..adda078d6df72082307517b1ef4a5324d8e4ba2c 100644 (file)
@@ -13,6 +13,7 @@ config ARM64
        select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_DMA_COHERENT_TO_PFN
        select ARCH_HAS_DMA_MMAP_PGPROT
+       select ARCH_HAS_DMA_PREP_COHERENT
        select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_FAST_MULTIPLIER
index 725a115759c97695eec204f2c15ca399eab234ee..2c3178848b7dcbc5e66982d2ca9dba8c54cdeebc 100644 (file)
@@ -1,6 +1,7 @@
 config CSKY
        def_bool y
        select ARCH_32BIT_OFF_T
+       select ARCH_HAS_DMA_PREP_COHERENT
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
        select ARCH_USE_BUILTIN_BSWAP
index 69b36ed31a99c6300ad4dd4216ae570b592f2f87..9741767e400fbff4e94a56934187fb1920fd510a 100644 (file)
@@ -72,6 +72,12 @@ static inline void arch_sync_dma_for_cpu_all(struct device *dev)
 }
 #endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */
 
+#ifdef CONFIG_ARCH_HAS_DMA_PREP_COHERENT
 void arch_dma_prep_coherent(struct page *page, size_t size);
+#else
+static inline void arch_dma_prep_coherent(struct page *page, size_t size)
+{
+}
+#endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */
 
 #endif /* _LINUX_DMA_NONCOHERENT_H */
index 52b704e2b97adee59bbd07023047d9681286cf99..83d711f8d665d872581d4a3b5023bdf43cbd84c6 100644 (file)
@@ -38,6 +38,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
 config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
        bool
 
+config ARCH_HAS_DMA_PREP_COHERENT
+       bool
+
 config ARCH_HAS_DMA_COHERENT_TO_PFN
        bool