Skip to content

Commit c00a60d

Browse files
FlyGoatChristoph Hellwig
authored andcommitted
of: address: always use dma_default_coherent for default coherency
As for now all arches have dma_default_coherent reflecting default DMA coherency for of devices, so there is no need to have a standalone config option. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 1d3f56b commit c00a60d

4 files changed

Lines changed: 3 additions & 7 deletions

File tree

arch/powerpc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ config PPC
113113
#
114114
select ARCH_32BIT_OFF_T if PPC32
115115
select ARCH_DISABLE_KASAN_INLINE if PPC_RADIX_MMU
116+
select ARCH_DMA_DEFAULT_COHERENT if !NOT_COHERENT_CACHE
116117
select ARCH_ENABLE_MEMORY_HOTPLUG
117118
select ARCH_ENABLE_MEMORY_HOTREMOVE
118119
select ARCH_HAS_COPY_MC if PPC64
@@ -272,7 +273,6 @@ config PPC
272273
select NEED_PER_CPU_PAGE_FIRST_CHUNK if PPC64
273274
select NEED_SG_DMA_LENGTH
274275
select OF
275-
select OF_DMA_DEFAULT_COHERENT if !NOT_COHERENT_CACHE
276276
select OF_EARLY_FLATTREE
277277
select OLD_SIGACTION if PPC32
278278
select OLD_SIGSUSPEND

arch/riscv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ config 32BIT
1212

1313
config RISCV
1414
def_bool y
15+
select ARCH_DMA_DEFAULT_COHERENT
1516
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
1617
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
1718
select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
@@ -121,7 +122,6 @@ config RISCV
121122
select MODULES_USE_ELF_RELA if MODULES
122123
select MODULE_SECTIONS if MODULES
123124
select OF
124-
select OF_DMA_DEFAULT_COHERENT
125125
select OF_EARLY_FLATTREE
126126
select OF_IRQ
127127
select PCI_DOMAINS_GENERIC if PCI

drivers/of/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,4 @@ config OF_OVERLAY
102102
config OF_NUMA
103103
bool
104104

105-
config OF_DMA_DEFAULT_COHERENT
106-
# arches should select this if DMA is coherent by default for OF devices
107-
bool
108-
109105
endif # OF

drivers/of/address.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ phys_addr_t __init of_dma_get_max_cpu_address(struct device_node *np)
11031103
bool of_dma_is_coherent(struct device_node *np)
11041104
{
11051105
struct device_node *node;
1106-
bool is_coherent = IS_ENABLED(CONFIG_OF_DMA_DEFAULT_COHERENT);
1106+
bool is_coherent = dma_default_coherent;
11071107

11081108
node = of_node_get(np);
11091109

0 commit comments

Comments
 (0)