Skip to contentSkip to conversation

iommu: SUN50I_IOMMU should depend on HAS_DMA

PATCH In review Geert Uytterhoeven 4 participants 5 messages Jun 29, 2020 – Jun 30, 2020 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu: SUN50I_IOMMU should depend on HAS_DMA

If NO_DMA=y (e.g. Sun-3 all{mod,yes}-config):

drivers/iommu/dma-iommu.o: In function `iommu_dma_mmap':
dma-iommu.c:(.text+0x92e): undefined reference to `dma_pgprot'

IOMMU_DMA must not be selected, unless HAS_DMA=y.

Hence fix this by making SUN50I_IOMMU depend on HAS_DMA.

Fixes 4100b8c229b32835 ("iommu: Add Allwinner H6 IOMMU driver")
---
 drivers/iommu/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/iommu/Kconfig +1 -0
index 6dc49ed8377a5c12..b0f308cb7f7c2fc2 100644
@@ -305,6 +305,7 @@ config ROCKCHIP_IOMMU
 
 config SUN50I_IOMMU
 	bool "Allwinner H6 IOMMU Support"
+	depends on HAS_DMA
 	depends on ARCH_SUNXI || COMPILE_TEST
 	select ARM_DMA_USE_IOMMU
 	select IOMMU_API
Signature · 6 lines
2.17.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Geert Uytterhoeven

If NO_DMA=y (e.g. Sun-3 all{mod,yes}-config):

drivers/iommu/dma-iommu.o: In function `iommu_dma_mmap':
dma-iommu.c:(.text+0x92e): undefined reference to `dma_pgprot'

IOMMU_DMA must not be selected, unless HAS_DMA=y.

Hence fix this by making SUN50I_IOMMU depend on HAS_DMA.

Fixes 4100b8c229b32835 ("iommu: Add Allwinner H6 IOMMU driver")

Thanks!
Maxime

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

reviewer
#2 lore raw
In reply to Geert Uytterhoeven
Quoted 6 lines · Geert Uytterhoeven

If NO_DMA=y (e.g. Sun-3 all{mod,yes}-config):

drivers/iommu/dma-iommu.o: In function `iommu_dma_mmap':
dma-iommu.c:(.text+0x92e): undefined reference to `dma_pgprot'

IOMMU_DMA must not be selected, unless HAS_DMA=y.

Wait, no, IOMMU_DMA should not be selected by drivers at all - it's for arch code to choose.

x86 just complicates matters with some of its arch code being in its IOMMU drivers...

Robin.

Quoted 14 lines

Hence fix this by making SUN50I_IOMMU depend on HAS_DMA.

Fixes 4100b8c229b32835 ("iommu: Add Allwinner H6 IOMMU driver")
---
  drivers/iommu/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/iommu/Kconfig +0 -0
index 6dc49ed8377a5c12..b0f308cb7f7c2fc2 100644

drivers/iommu/Kconfig config ROCKCHIP_IOMMU · line 311

Quoted 7 lines
drivers/iommu/Kconfig +1 -0
@@ -305,6 +305,7 @@ config ROCKCHIP_IOMMU
 
  config SUN50I_IOMMU
  	bool "Allwinner H6 IOMMU Support"
+	depends on HAS_DMA
  	depends on ARCH_SUNXI || COMPILE_TEST
  	select ARM_DMA_USE_IOMMU
  	select IOMMU_API

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

maintainer
#3 lore raw
Quoted 10 lines · Robin Murphy
Quoted 6 lines · Geert Uytterhoeven

If NO_DMA=y (e.g. Sun-3 all{mod,yes}-config):

drivers/iommu/dma-iommu.o: In function `iommu_dma_mmap':
dma-iommu.c:(.text+0x92e): undefined reference to `dma_pgprot'

IOMMU_DMA must not be selected, unless HAS_DMA=y.

Wait, no, IOMMU_DMA should not be selected by drivers at all - it's for arch code to choose.

Okay, but that is a different fix, right? I queued this patch for v5.8 for now.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

reviewer
#4 lore raw
Quoted 7 lines · Joerg Roedel
Quoted 6 lines · Robin Murphy
Quoted 5 lines · Geert Uytterhoeven

If NO_DMA=y (e.g. Sun-3 all{mod,yes}-config):

drivers/iommu/dma-iommu.o: In function `iommu_dma_mmap':
dma-iommu.c:(.text+0x92e): undefined reference to `dma_pgprot'

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

IOMMU_DMA must not be selected, unless HAS_DMA=y.

Wait, no, IOMMU_DMA should not be selected by drivers at all - it's for arch code to choose.

Okay, but that is a different fix, right? I queued this patch for v5.8 for now.

If the driver didn't select IOMMU_DMA (completely unnecessarily, I might add), there wouldn't be any problem to fix in the first place ;)

Robin.