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
13 select ARCH_HAS_DEVMEM_IS_ALLOWED13 select ARCH_HAS_DEVMEM_IS_ALLOWED
14 select ARCH_HAS_DMA_COHERENT_TO_PFN14 select ARCH_HAS_DMA_COHERENT_TO_PFN
15 select ARCH_HAS_DMA_MMAP_PGPROT15 select ARCH_HAS_DMA_MMAP_PGPROT
16 select ARCH_HAS_DMA_PREP_COHERENT
16 select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI17 select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
17 select ARCH_HAS_ELF_RANDOMIZE18 select ARCH_HAS_ELF_RANDOMIZE
18 select ARCH_HAS_FAST_MULTIPLIER19 select ARCH_HAS_FAST_MULTIPLIER
arch/csky/Kconfig+1−0
@@ -1,6 +1,7 @@
1config CSKY1config CSKY
2 def_bool y2 def_bool y
3 select ARCH_32BIT_OFF_T3 select ARCH_32BIT_OFF_T
4 select ARCH_HAS_DMA_PREP_COHERENT
4 select ARCH_HAS_SYNC_DMA_FOR_CPU5 select ARCH_HAS_SYNC_DMA_FOR_CPU
5 select ARCH_HAS_SYNC_DMA_FOR_DEVICE6 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
6 select ARCH_USE_BUILTIN_BSWAP7 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
72}72}
73#endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */73#endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */
74 74
75#ifdef CONFIG_ARCH_HAS_DMA_PREP_COHERENT
75void arch_dma_prep_coherent(struct page *page, size_t size);76void arch_dma_prep_coherent(struct page *page, size_t size);
77#else
78static inline void arch_dma_prep_coherent(struct page *page, size_t size)
79{
80}
81#endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */
76 82
77#endif /* _LINUX_DMA_NONCOHERENT_H */83#endif /* _LINUX_DMA_NONCOHERENT_H */
kernel/dma/Kconfig+3−0
@@ -38,6 +38,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU · 37 unmodified lines
38config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL38config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
39 bool39 bool
40 40
41config ARCH_HAS_DMA_PREP_COHERENT
42 bool
43
41config ARCH_HAS_DMA_COHERENT_TO_PFN44config ARCH_HAS_DMA_COHERENT_TO_PFN
42 bool45 bool
43 46

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