Skip to contentSkip to conversation

fix a few RISC-V / renesas Kconfig dependencies v2

PATCH In review Christoph Hellwig 3 participants 6 messages Oct 18, 2023 – Oct 26, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

Changes since v1:
- select DMA_DIRECT_REMAP from ERRATA_THEAD_CMO

#1 lore raw

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
index d607ab0f7c6daf..0ac0b538379718 100644
@@ -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
index a57677f908f3ba..d6e5e3abaad8af 100644
@@ -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
#2 lore raw

PATCH 2/3 riscv: only select DMA_DIRECT_REMAP from RISCV_ISA_ZICBOM and ERRATA_THEAD_PBMT

In reply to Christoph Hellwig

RISCV_DMA_NONCOHERENT is also used for whacky non-standard non-coherent ops that use different hooks in dma-direct.

---
 arch/riscv/Kconfig        | 2 +-
 arch/riscv/Kconfig.errata | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
index 0ac0b538379718..9c48fecc671918 100644
@@ -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
arch/riscv/Kconfig.errata +1 -0
index 566bcefeab502c..e2c731cfed8cc6 100644
@@ -77,6 +77,7 @@ config ERRATA_THEAD_PBMT
 config ERRATA_THEAD_CMO
 	bool "Apply T-Head cache management errata"
 	depends on ERRATA_THEAD && MMU
+	select DMA_DIRECT_REMAP
 	select RISCV_DMA_NONCOHERENT
 	default y
 	help
Signature · 1 line
2.39.2
Tested-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] riscv: only select DMA_DIRECT_REMAP from RISCV_ISA_ZICBOM and ERRATA_THEAD_PBMT

Quoted 11 lines · Christoph Hellwig

RISCV_DMA_NONCOHERENT is also used for whacky non-standard non-coherent ops that use different hooks in dma-direct.

---
 arch/riscv/Kconfig        | 2 +-
 arch/riscv/Kconfig.errata | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
#4 lore raw

PATCH 3/3 soc: renesas: ARCH_R9A07G043 depends on !RISCV_ISA_ZICBOM

In reply to Christoph Hellwig

ARCH_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
index 335251ff6e8214..624185e09c967b 100644
@@ -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
#5 lore raw
In reply to Christoph Hellwig

Hi Christoph,

Quoted 2 lines · Christoph Hellwig

this small series sorts out a few Kconfig dependency issue for the rich set of RISC-V non-coherent DMA support.

Thanks for your series!

Quoted 3 lines

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.

As Arnd asked me to send a PR to him, I'm queuing these in renesas-fixes, and will send a PR momentarily.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds