Skip to content

Commit 9ae1f26

Browse files
committed
MIPS: Don't select ARCH_HAS_SYNC_DMA_FOR_CPU when DMA is coherent
Commit f263f2a ("MIPS: Compile post DMA flush only when needed") pushed the selection of ARCH_HAS_SYNC_DMA_FOR_CPU down to various SYS_HAS_CPU_* Kconfig entries corresponding to CPUs for which cpu_needs_post_dma_flush() might return true, but unfortunately missed the fact that some of these CPUs can be used in configurations with DMA_NONCOHERENT=n. When this is the case the kernel build does not include our definition of arch_sync_dma_for_cpu() from arch/mips/mm/dma-noncoherent.c and the build fails with a link error. One example of this problem is ip27_defconfig: kernel/dma/direct.o: In function `dma_direct_sync_single_for_cpu': direct.c:(.text+0x6c): undefined reference to `arch_sync_dma_for_cpu' kernel/dma/direct.o: In function `dma_direct_sync_sg_for_cpu': direct.c:(.text+0x1f0): undefined reference to `arch_sync_dma_for_cpu' kernel/dma/direct.o: In function `dma_direct_alloc': direct.c:(.text+0xc20): undefined reference to `arch_dma_alloc' kernel/dma/direct.o: In function `dma_direct_free': direct.c:(.text+0xc3c): undefined reference to `arch_dma_free' make[1]: *** [Makefile:1021: vmlinux] Error 1 make: *** [Makefile:152: sub-make] Error 2 Fix this by selecting ARCH_HAS_SYNC_DMA_FOR_CPU only when DMA_NONCOHERENT is also selected. The SYS_HAS_CPU_BMIPS5000 case is left as-is because systems with that CPU always select DMA_NONCOHERENT anyway. Signed-off-by: Paul Burton <paul.burton@mips.com> Fixes: f263f2a ("MIPS: Compile post DMA flush only when needed")
1 parent afd375d commit 9ae1f26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/mips/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,11 +1931,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
19311931

19321932
config SYS_HAS_CPU_MIPS32_R5
19331933
bool
1934-
select ARCH_HAS_SYNC_DMA_FOR_CPU
1934+
select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT
19351935

19361936
config SYS_HAS_CPU_MIPS32_R6
19371937
bool
1938-
select ARCH_HAS_SYNC_DMA_FOR_CPU
1938+
select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT
19391939

19401940
config SYS_HAS_CPU_MIPS64_R1
19411941
bool
@@ -1945,7 +1945,7 @@ config SYS_HAS_CPU_MIPS64_R2
19451945

19461946
config SYS_HAS_CPU_MIPS64_R6
19471947
bool
1948-
select ARCH_HAS_SYNC_DMA_FOR_CPU
1948+
select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT
19491949

19501950
config SYS_HAS_CPU_R3000
19511951
bool
@@ -1982,7 +1982,7 @@ config SYS_HAS_CPU_R8000
19821982

19831983
config SYS_HAS_CPU_R10000
19841984
bool
1985-
select ARCH_HAS_SYNC_DMA_FOR_CPU
1985+
select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT
19861986

19871987
config SYS_HAS_CPU_RM7000
19881988
bool

0 commit comments

Comments
 (0)