fix a few RISC-V / renesas Kconfig dependencies
Hi all,
this small series sorts out a few Kconfig dependency issue for the rich set of RISC-V non-coherent DMA support.
Geert suggested for it to go into the soc tree, which is fine with me if I get a stable branch for it as it is required for further dma-mapping work.
PATCH 1/3 riscv: RISCV_NONSTANDARD_CACHE_OPS shouldn't depend on RISCV_DMA_NONCOHERENT
RISCV_NONSTANDARD_CACHE_OPS is also used for the pmem cache maintenance helpers, which are built into the kernel unconditionally.
--- arch/riscv/Kconfig | 1 - drivers/cache/Kconfig | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
arch/riscv/Kconfig +0 -1
@@ -277,7 +277,6 @@ config RISCV_DMA_NONCOHERENT config RISCV_NONSTANDARD_CACHE_OPS bool - depends on RISCV_DMA_NONCOHERENT help This enables function pointer support for non-standard noncoherent systems to handle cache management.
drivers/cache/Kconfig +1 -1
@@ -3,7 +3,7 @@ menu "Cache Drivers" config AX45MP_L2_CACHE bool "Andes Technology AX45MP L2 Cache controller" - depends on RISCV_DMA_NONCOHERENT + depends on RISCV select RISCV_NONSTANDARD_CACHE_OPS help Support for the L2 cache controller on Andes Technology AX45MP platforms.
Signature · 1 line
2.39.2
PATCH 2/3 riscv: only select DMA_DIRECT_REMAP from RISCV_ISA_ZICBOM
In reply to Christoph HellwigRISCV_DMA_NONCOHERENT is also used for whacky non-standard non-coherent ops that use different hooks in dma-direct.
--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
@@ -273,7 +273,6 @@ config RISCV_DMA_NONCOHERENT select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYNC_DMA_FOR_DEVICE select DMA_BOUNCE_UNALIGNED_KMALLOC if SWIOTLB - select DMA_DIRECT_REMAP if MMU config RISCV_NONSTANDARD_CACHE_OPS bool
@@ -549,6 +548,7 @@ config RISCV_ISA_ZICBOM depends on RISCV_ALTERNATIVE default y select RISCV_DMA_NONCOHERENT + select DMA_DIRECT_REMAP help Adds support to dynamically detect the presence of the ZICBOM extension (Cache Block Management Operations) and enable its
Signature · 1 line
2.39.2
Re: [PATCH 2/3] riscv: only select DMA_DIRECT_REMAP from RISCV_ISA_ZICBOM
Quoted 16 lines · Christoph Hellwig
RISCV_DMA_NONCOHERENTis also used for whacky non-standard non-coherent ops that use different hooks in dma-direct.Signed-off-by Christoph Hellwig <[email protected]>Reviewed-by Conor Dooley <[email protected]>Reviewed-by Robin Murphy <[email protected]>Reviewed-by Lad Prabhakar <[email protected]>--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/Kconfig +0
-0
arch/riscv/Kconfig config RISCV_DMA_NONCOHERENT · line 276
Quoted 4 lines
arch/riscv/Kconfig +0
-1@@ -273,7 +273,6 @@ config RISCV_DMA_NONCOHERENT select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYNC_DMA_FOR_DEVICE select DMA_BOUNCE_UNALIGNED_KMALLOC if SWIOTLB - select DMA_DIRECT_REMAP if MMU
This breaks ERRATA_THEAD_CMO, which also needs a select DMA_DIRECT_REMAP:
riscv64-unknown-linux-gnu-ld: kernel/dma/direct.o: in function `.L131':
direct.c:(.text+0x42a): undefined reference to arch_dma_alloc' riscv64-unknown-linux-gnu-ld: kernel/dma/direct.o: in function .L192':
direct.c:(.text+0x592): undefined reference to `arch_dma_free'
Quoted 10 lines
arch/riscv/Kconfig +1
-0config RISCV_NONSTANDARD_CACHE_OPS bool@@ -549,6 +548,7 @@ config RISCV_ISA_ZICBOM depends on RISCV_ALTERNATIVE default y select RISCV_DMA_NONCOHERENT + select DMA_DIRECT_REMAP help Adds support to dynamically detect the presence of the ZICBOM extension (Cache Block Management Operations) and enable its
PATCH 3/3 soc: renesas: ARCH_R9A07G043 depends on !RISCV_ISA_ZICBOM
In reply to Christoph HellwigARCH_R9A07G043 has its own non-standard global pool based DMA coherent allocator, which conflicts with the remap based RISCV_ISA_ZICBOM version. Add a proper dependency.
--- drivers/soc/renesas/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/soc/renesas/Kconfig +1 -0
@@ -341,6 +341,7 @@ config ARCH_R9A07G043 bool "RISC-V Platform support for RZ/Five" depends on NONPORTABLE depends on RISCV_ALTERNATIVE + depends on !RISCV_ISA_ZICBOM depends on RISCV_SBI select ARCH_RZG2L select AX45MP_L2_CACHE
Signature · 1 line
2.39.2