Skip to content

Commit de6c85b

Browse files
author
Christoph Hellwig
committed
dma-mapping: clearly mark DMA ops as an architecture feature
DMA ops are a helper for architectures and not for drivers to override the DMA implementation. Unfortunately driver authors keep ignoring this. Make the fact more clear by renaming the symbol to ARCH_HAS_DMA_OPS and having the two drivers overriding their dma_ops depend on that. These drivers should probably be marked broken, but we can give them a bit of a grace period for that. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Acked-by: Sakari Ailus <[email protected]> # for IPU6 Acked-by: Robin Murphy <[email protected]>
1 parent 92193b3 commit de6c85b

File tree

18 files changed

+41
-26
lines changed

18 files changed

+41
-26
lines changed

arch/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ config CPU_MITIGATIONS
1717
def_bool y
1818
endif
1919

20+
#
21+
# Selected by architectures that need custom DMA operations for e.g. legacy
22+
# IOMMUs not handled by dma-iommu. Drivers must never select this symbol.
23+
#
24+
config ARCH_HAS_DMA_OPS
25+
depends on HAS_DMA
26+
select DMA_OPS_HELPERS
27+
bool
28+
2029
menu "General architecture-dependent options"
2130

2231
config ARCH_HAS_SUBPAGE_FAULTS

arch/alpha/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ config ALPHA
44
default y
55
select ARCH_32BIT_USTAT_F_TINODE
66
select ARCH_HAS_CURRENT_STACK_POINTER
7+
select ARCH_HAS_DMA_OPS if PCI
78
select ARCH_MIGHT_HAVE_PC_PARPORT
89
select ARCH_MIGHT_HAVE_PC_SERIO
910
select ARCH_NO_PREEMPT
1011
select ARCH_NO_SG_CHAIN
1112
select ARCH_USE_CMPXCHG_LOCKREF
12-
select DMA_OPS if PCI
1313
select FORCE_PCI
1414
select PCI_DOMAINS if PCI
1515
select PCI_SYSCALL if PCI

arch/arm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config ARM
1010
select ARCH_HAS_CURRENT_STACK_POINTER
1111
select ARCH_HAS_DEBUG_VIRTUAL if MMU
1212
select ARCH_HAS_DMA_ALLOC if MMU
13+
select ARCH_HAS_DMA_OPS
1314
select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE
1415
select ARCH_HAS_ELF_RANDOMIZE
1516
select ARCH_HAS_FORTIFY_SOURCE
@@ -54,7 +55,6 @@ config ARM
5455
select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
5556
select DMA_DECLARE_COHERENT
5657
select DMA_GLOBAL_POOL if !MMU
57-
select DMA_OPS
5858
select DMA_NONCOHERENT_MMAP if MMU
5959
select EDAC_SUPPORT
6060
select EDAC_ATOMIC_SCRUB

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ config ARM64
2424
select ARCH_HAS_CURRENT_STACK_POINTER
2525
select ARCH_HAS_DEBUG_VIRTUAL
2626
select ARCH_HAS_DEBUG_VM_PGTABLE
27+
select ARCH_HAS_DMA_OPS if XEN
2728
select ARCH_HAS_DMA_PREP_COHERENT
2829
select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
2930
select ARCH_HAS_FAST_MULTIPLIER

arch/mips/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ config MIPS
88
select ARCH_HAS_CPU_FINALIZE_INIT
99
select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
1010
select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
11+
select ARCH_HAS_DMA_OPS if MACH_JAZZ
1112
select ARCH_HAS_FORTIFY_SOURCE
1213
select ARCH_HAS_KCOV
1314
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE if !EVA
@@ -393,7 +394,6 @@ config MACH_JAZZ
393394
select ARC_PROMLIB
394395
select ARCH_MIGHT_HAVE_PC_PARPORT
395396
select ARCH_MIGHT_HAVE_PC_SERIO
396-
select DMA_OPS
397397
select FW_ARC
398398
select FW_ARC32
399399
select ARCH_MAY_HAVE_PC_FDC

arch/parisc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config PARISC
1010
select ARCH_WANT_FRAME_POINTERS
1111
select ARCH_HAS_CPU_CACHE_ALIASING
1212
select ARCH_HAS_DMA_ALLOC if PA11
13+
select ARCH_HAS_DMA_OPS
1314
select ARCH_HAS_ELF_RANDOMIZE
1415
select ARCH_HAS_STRICT_KERNEL_RWX
1516
select ARCH_HAS_STRICT_MODULE_RWX
@@ -23,7 +24,6 @@ config PARISC
2324
select ARCH_HAS_CACHE_LINE_SIZE
2425
select ARCH_HAS_DEBUG_VM_PGTABLE
2526
select HAVE_RELIABLE_STACKTRACE
26-
select DMA_OPS
2727
select RTC_CLASS
2828
select RTC_DRV_GENERIC
2929
select INIT_ALL_POSSIBLE

arch/powerpc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ config PPC
133133
select ARCH_HAS_DEBUG_WX if STRICT_KERNEL_RWX
134134
select ARCH_HAS_DEVMEM_IS_ALLOWED
135135
select ARCH_HAS_DMA_MAP_DIRECT if PPC_PSERIES
136+
select ARCH_HAS_DMA_OPS if PPC64
136137
select ARCH_HAS_FORTIFY_SOURCE
137138
select ARCH_HAS_GCOV_PROFILE_ALL
138139
select ARCH_HAS_KCOV
@@ -185,7 +186,6 @@ config PPC
185186
select CPUMASK_OFFSTACK if NR_CPUS >= 8192
186187
select DCACHE_WORD_ACCESS if PPC64 && CPU_LITTLE_ENDIAN
187188
select DMA_OPS_BYPASS if PPC64
188-
select DMA_OPS if PPC64
189189
select DYNAMIC_FTRACE if FUNCTION_TRACER
190190
select EDAC_ATOMIC_SCRUB
191191
select EDAC_SUPPORT

arch/s390/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ config S390
7070
select ARCH_HAS_DEBUG_VM_PGTABLE
7171
select ARCH_HAS_DEBUG_WX
7272
select ARCH_HAS_DEVMEM_IS_ALLOWED
73+
select ARCH_HAS_DMA_OPS if PCI
7374
select ARCH_HAS_ELF_RANDOMIZE
7475
select ARCH_HAS_FORCE_DMA_UNENCRYPTED
7576
select ARCH_HAS_FORTIFY_SOURCE
@@ -137,7 +138,6 @@ config S390
137138
select BUILDTIME_TABLE_SORT
138139
select CLONE_BACKWARDS2
139140
select DCACHE_WORD_ACCESS if !KMSAN
140-
select DMA_OPS if PCI
141141
select DYNAMIC_FTRACE if FUNCTION_TRACER
142142
select FUNCTION_ALIGNMENT_8B if CC_IS_GCC
143143
select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC

arch/sparc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ config SPARC
1414
bool
1515
default y
1616
select ARCH_HAS_CPU_CACHE_ALIASING
17+
select ARCH_HAS_DMA_OPS
1718
select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
1819
select ARCH_MIGHT_HAVE_PC_SERIO
19-
select DMA_OPS
2020
select OF
2121
select OF_PROMTREE
2222
select HAVE_ASM_MODVERSIONS

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ config X86
7979
select ARCH_HAS_DEBUG_VIRTUAL
8080
select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE
8181
select ARCH_HAS_DEVMEM_IS_ALLOWED
82+
select ARCH_HAS_DMA_OPS if GART_IOMMU || XEN
8283
select ARCH_HAS_EARLY_DEBUG if KGDB
8384
select ARCH_HAS_ELF_RANDOMIZE
8485
select ARCH_HAS_FAST_MULTIPLIER
@@ -943,7 +944,6 @@ config DMI
943944

944945
config GART_IOMMU
945946
bool "Old AMD GART IOMMU support"
946-
select DMA_OPS
947947
select IOMMU_HELPER
948948
select SWIOTLB
949949
depends on X86_64 && PCI && AMD_NB

0 commit comments

Comments
 (0)