History

dma-mapping: add a Kconfig symbol to indicate arch_dma_prep_coherent presence

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.

Christoph Hellwig committed 7 years ago

Commit 13bf5ce1 parent 148a97d4 files · +11 −0Browse files

Unified · Split

4 files
  1. arch/arm64/Kconfig +1 −0
  2. arch/csky/Kconfig +1 −0
  3. include/linux/dma-noncoherent.h +6 −0
  4. kernel/dma/Kconfig +3 −0
arch/arm64/Kconfig+1−0
@@ -13,6 +13,7 @@ config ARM64 · 12 unmodified lines
1313 select ARCH_HAS_DEVMEM_IS_ALLOWED
1414 select ARCH_HAS_DMA_COHERENT_TO_PFN
1515 select ARCH_HAS_DMA_MMAP_PGPROT
16+ select ARCH_HAS_DMA_PREP_COHERENT
1617 select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
1718 select ARCH_HAS_ELF_RANDOMIZE
1819 select ARCH_HAS_FAST_MULTIPLIER
arch/csky/Kconfig+1−0
@@ -1,6 +1,7 @@
11 config CSKY
22 def_bool y
33 select ARCH_32BIT_OFF_T
4+ select ARCH_HAS_DMA_PREP_COHERENT
45 select ARCH_HAS_SYNC_DMA_FOR_CPU
56 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
67 select ARCH_USE_BUILTIN_BSWAP
include/linux/dma-noncoherent.h+6−0
@@ -72,6 +72,12 @@ static inline void arch_sync_dma_for_cpu_all(struct device *dev) · 71 unmodified lines
7272 }
7373 #endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */
7474
75+#ifdef CONFIG_ARCH_HAS_DMA_PREP_COHERENT
7576 void arch_dma_prep_coherent(struct page *page, size_t size);
77+#else
78+static inline void arch_dma_prep_coherent(struct page *page, size_t size)
79+{
80+}
81+#endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */
7682
7783 #endif /* _LINUX_DMA_NONCOHERENT_H */
kernel/dma/Kconfig+3−0
@@ -38,6 +38,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU · 37 unmodified lines
3838 config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
3939 bool
4040
41+config ARCH_HAS_DMA_PREP_COHERENT
42+ bool
43+
4144 config ARCH_HAS_DMA_COHERENT_TO_PFN
4245 bool
4346

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t