Skip to contentSkip to conversation

MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms

PATCH In review Christoph Hellwig 3 participants 3 messages Jun 30, 2019 – Jul 3, 2019 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms

While mips might architecturally have the uncached segment all the time, the infrastructure to use it is only need on platforms where DMA is at least partially incoherent. Only select it for those configuration to fix a build failure as the arch_dma_prep_coherent symbol is also only provided for non-coherent platforms.

Fixes 2e96e04d25 ("MIPS: use the generic uncached segment support in dma-direct")
---
 arch/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/Kconfig +1 -1
index 61a390c2f2c1..caf480275a31 100644
@@ -8,7 +8,6 @@ config MIPS
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
-	select ARCH_HAS_UNCACHED_SEGMENT
 	select ARCH_SUPPORTS_UPROBES
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
@@ -1120,6 +1119,7 @@ config DMA_NONCOHERENT
 	bool
 	select ARCH_HAS_DMA_MMAP_PGPROT
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
+	select ARCH_HAS_UNCACHED_SEGMENT
 	select NEED_DMA_MAP_STATE
 	select ARCH_HAS_DMA_COHERENT_TO_PFN
 	select DMA_NONCOHERENT_CACHE_SYNC
Signature · 1 line
2.20.1
Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · Christoph Hellwig

While mips might architecturally have the uncached segment all the time, the infrastructure to use it is only need on platforms where DMA is at least partially incoherent. Only select it for those configuration to fix a build failure as the arch_dma_prep_coherent symbol is also only provided for non-coherent platforms.

Fixes 2e96e04d25 ("MIPS: use the generic uncached segment support in dma-direct")

---

This patch fixes

kernel/dma/direct.c:144: undefined reference to `arch_dma_prep_coherent'

Mips images still don't boot in -next after this patch is applied, so "Tested-by:" only means that affected configurations now build without link error, not that they actually work.

Guenter

Quoted 24 lines
  arch/mips/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/Kconfig +1 -1
index 61a390c2f2c1..caf480275a31 100644
@@ -8,7 +8,6 @@ config MIPS
  	select ARCH_HAS_ELF_RANDOMIZE
  	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
  	select ARCH_HAS_UBSAN_SANITIZE_ALL
-	select ARCH_HAS_UNCACHED_SEGMENT
  	select ARCH_SUPPORTS_UPROBES
  	select ARCH_USE_BUILTIN_BSWAP
  	select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
@@ -1120,6 +1119,7 @@ config DMA_NONCOHERENT
  	bool
  	select ARCH_HAS_DMA_MMAP_PGPROT
  	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
+	select ARCH_HAS_UNCACHED_SEGMENT
  	select NEED_DMA_MAP_STATE
  	select ARCH_HAS_DMA_COHERENT_TO_PFN
  	select DMA_NONCOHERENT_CACHE_SYNC
Acked-by on v1 1/1
#2 lore raw
In reply to Christoph Hellwig

Hi Christoph,

Quoted 9 lines · Christoph Hellwig

While mips might architecturally have the uncached segment all the time, the infrastructure to use it is only need on platforms where DMA is at least partially incoherent. Only select it for those configuration to fix a build failure as the arch_dma_prep_coherent symbol is also only provided for non-coherent platforms.

Fixes 2e96e04d25 ("MIPS: use the generic uncached segment support in dma-direct")

Thanks,
Paul