Skip to contentSkip to conversation

iommu: Small fixes and cleanups

PATCH Applied Joerg Roedel 6 participants 11 messages Jan 26, 2015 – Feb 4, 2015 3 messages not in the archive IOMMU

lore
Share & tools
lore

Joerg Roedel

author maintainer
#0 lore raw

cover iommu: Small fixes and cleanups

Hi,

here are a couple of iommu fixes and cleanups to fix compile errors and some warnings on ARM and PPC.

Regards,

Joerg

Joerg Roedel (4):
iommu: Make more drivers depend on COMPILE_TEST
iommu/exynos: Make driver depend on REGULATOR
iommu/omap: Print phys_addr_t using %pa
iommu/fsl: Use %pa to print phys_addr_t

 drivers/iommu/Kconfig      | 11 +++++++----
 drivers/iommu/fsl_pamu.c   |  4 ++--
 drivers/iommu/omap-iommu.c |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)
Signature · 1 line
1.9.1
author maintainer
#1 lore raw

PATCH 1/4 iommu: Make more drivers depend on COMPILE_TEST

From: Joerg Roedel <[email protected]>

For easier compile testing of these iommu drivers.

---
 drivers/iommu/Kconfig | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/iommu/Kconfig +6 -3
index 325188e..dfa6cf1 100644
@@ -19,7 +19,8 @@ config OF_IOMMU
 
 config FSL_PAMU
 	bool "Freescale IOMMU support"
-	depends on PPC_E500MC
+	depends on PPC32
+	depends on PPC_E500MC || COMPILE_TEST
 	select IOMMU_API
 	select GENERIC_ALLOCATOR
 	help
@@ -30,7 +31,8 @@ config FSL_PAMU
 # MSM IOMMU support
 config MSM_IOMMU
 	bool "MSM IOMMU Support"
-	depends on ARCH_MSM8X60 || ARCH_MSM8960
+	depends on ARM
+	depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
 	select IOMMU_API
 	help
 	  Support for the IOMMUs found on certain Qualcomm SOCs.
@@ -140,7 +142,8 @@ config IRQ_REMAP
 # OMAP IOMMU support
 config OMAP_IOMMU
 	bool "OMAP IOMMU Support"
-	depends on ARCH_OMAP2PLUS
+	depends on ARM
+	depends on ARCH_OMAP2PLUS || COMPILE_TEST
 	select IOMMU_API
 
 config OMAP_IOMMU_DEBUG
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH 2/4 iommu/exynos: Make driver depend on REGULATOR

In reply to Joerg Roedel

From: Joerg Roedel <[email protected]>

When regulator is not selected during kconfig, linking of the exynos iommu driver fails due to missing symbols. Fix it!

---
 drivers/iommu/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/Kconfig +1 -1
index dfa6cf1..2e6100d 100644
@@ -190,7 +190,7 @@ config TEGRA_IOMMU_SMMU
 
 config EXYNOS_IOMMU
 	bool "Exynos IOMMU Support"
-	depends on ARCH_EXYNOS && ARM
+	depends on ARCH_EXYNOS && ARM && REGULATOR
 	select IOMMU_API
 	select ARM_DMA_USE_IOMMU
 	help
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1422316230-18893-3-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org

#4 lore raw

Re: [PATCH 2/4] iommu/exynos: Make driver depend on REGULATOR

Hello,

Quoted 5 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

When regulator is not selected during kconfig, linking of the exynos iommu driver fails due to missing symbols. Fix it!

Frankly, I never observed such issue. Could you provide the .config for such case? I know that existing exynos iommu driver is broken, but please, don't break it even more...

Quoted 10 lines
---
  drivers/iommu/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/Kconfig +0 -0
index dfa6cf1..2e6100d 100644

drivers/iommu/Kconfig config TEGRA_IOMMU_SMMU · line 196

Quoted 8 lines
drivers/iommu/Kconfig +1 -1
@@ -190,7 +190,7 @@ config TEGRA_IOMMU_SMMU
 
  config EXYNOS_IOMMU
  	bool "Exynos IOMMU Support"
-	depends on ARCH_EXYNOS && ARM
+	depends on ARCH_EXYNOS && ARM && REGULATOR
  	select IOMMU_API
  	select ARM_DMA_USE_IOMMU
  	help

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
#5 lore raw

Re: [PATCH 2/4] iommu/exynos: Make driver depend on REGULATOR

In reply to Joerg Roedel
Quoted 5 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

When regulator is not selected during kconfig, linking of the exynos iommu driver fails due to missing symbols. Fix it!

Removed this patch from my tree, as the issue was somewhere else.

author maintainer
#6 lore raw

PATCH 3/4 iommu/omap: Print phys_addr_t using %pa

In reply to Joerg Roedel

From: Joerg Roedel <[email protected]>

Fixes this compile warning:

drivers/iommu/omap-iommu.c: In function 'omap_iommu_map':
drivers/iommu/omap-iommu.c:1139:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'phys_addr_t' [-Wformat=]
dev_dbg(dev, "mapping da 0x%lx to pa 0x%x size 0x%x\n", da, pa, bytes);

---
 drivers/iommu/omap-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/omap-iommu.c +1 -1
index bbb7dce..f59f857 100644
@@ -1126,7 +1126,7 @@ static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
 		return -EINVAL;
 	}
 
-	dev_dbg(dev, "mapping da 0x%lx to pa 0x%x size 0x%x\n", da, pa, bytes);
+	dev_dbg(dev, "mapping da 0x%lx to pa %pa size 0x%x\n", da, &pa, bytes);
 
 	iotlb_init_entry(&e, da, pa, omap_pgsz);
 
Signature · 1 line
1.9.1
author maintainer
#7 lore raw

PATCH 4/4 iommu/fsl: Use %pa to print phys_addr_t

In reply to Joerg Roedel

From: Joerg Roedel <[email protected]>

Fix two compile warnings.

---
 drivers/iommu/fsl_pamu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu.c +2 -2
index 80ac68d..e63904b 100644
@@ -352,7 +352,7 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size,
 	unsigned long fspi;
 
 	if ((win_size & (win_size - 1)) || win_size < PAMU_PAGE_SIZE) {
-		pr_debug("window size too small or not a power of two %llx\n", win_size);
+		pr_debug("window size too small or not a power of two %pa\n", &win_size);
 		return -EINVAL;
 	}
 
@@ -1138,7 +1138,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 
 	if (csd_port_id) {
 		dev_dbg(&pdev->dev, "creating coherency subdomain at address "
-			"0x%llx, size %zu, port id 0x%08x", ppaact_phys,
+			"%pa, size %zu, port id 0x%08x", &ppaact_phys,
 			mem_size, csd_port_id);
 
 		ret = create_csd(ppaact_phys, mem_size, csd_port_id);
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1422316230-18893-5-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org

#9 lore raw

Re: [PATCH 4/4] iommu/fsl: Use %pa to print phys_addr_t

Hello Joerg,

Quoted 14 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

Fix two compile warnings.

---
 drivers/iommu/fsl_pamu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu.c +0 -0
index 80ac68d..e63904b 100644

drivers/iommu/fsl_pamu.c int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size, · line 357

Quoted 7 lines
drivers/iommu/fsl_pamu.c +1 -1
@@ -352,7 +352,7 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size,
 	unsigned long fspi;
 
 	if ((win_size & (win_size - 1)) || win_size < PAMU_PAGE_SIZE) {
-		pr_debug("window size too small or not a power of two %llx\n", win_size);
+		pr_debug("window size too small or not a power of two %pa\n", &win_size);
 		return -EINVAL;
 	}

Somewhere around line 1124 there another opportunity for this fix:

Quoted 2 lines
drivers/iommu/fsl_pamu.c +0 -0
   1124         dev_dbg(&pdev->dev, "ppaact virt=%p phys=0x%llx\n", ppaact,
   1125                 (unsigned long long) ppaact_phys);

Cheers,

Quoted 9 lines
drivers/iommu/fsl_pamu.c +1 -1
@@ -1138,7 +1138,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 
 	if (csd_port_id) {
 		dev_dbg(&pdev->dev, "creating coherency subdomain at address "
-			"0x%llx, size %zu, port id 0x%08x", ppaact_phys,
+			"%pa, size %zu, port id 0x%08x", &ppaact_phys,
 			mem_size, csd_port_id);
 
 		ret = create_csd(ppaact_phys, mem_size, csd_port_id);

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

Re: [PATCH 4/4] iommu/fsl: Use %pa to print phys_addr_t

Quoted 20 lines · Emil Medve

Hello Joerg,

Quoted 16 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

Fix two compile warnings.

---
 drivers/iommu/fsl_pamu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu.c +0 -0
index 80ac68d..e63904b 100644
@@ -352,7 +352,7 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size,
 	unsigned long fspi;
 
Quoted 7 lines

drivers/iommu/fsl_pamu.c int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size, · line 357

Quoted 5 lines
drivers/iommu/fsl_pamu.c +1 -1
 	if ((win_size & (win_size - 1)) || win_size < PAMU_PAGE_SIZE) {
-		pr_debug("window size too small or not a power of two %llx\n", win_size);
+		pr_debug("window size too small or not a power of two %pa\n", &win_size);
 		return -EINVAL;
 	}

Somewhere around line 1124 there another opportunity for this fix:

Thanks, I updated the patch.

Joerg

Acked-by on the v1 series
#12 lore raw
In reply to Joerg Roedel

Hi Joerg,

Thank you for the patches.

Quoted 4 lines · On Tuesday 27 January 2015 00:50:26 Joerg Roedel wrote:

Hi,

here are a couple of iommu fixes and cleanups to fix compile errors and some warnings on ARM and PPC.

For the whole series,

Quoted 14 lines

Regards,

Joerg

Joerg Roedel (4):
iommu: Make more drivers depend on COMPILE_TEST
iommu/exynos: Make driver depend on REGULATOR
iommu/omap: Print phys_addr_t using %pa
iommu/fsl: Use %pa to print phys_addr_t

 drivers/iommu/Kconfig      | 11 +++++++----
 drivers/iommu/fsl_pamu.c   |  4 ++--
 drivers/iommu/omap-iommu.c |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer Applied
#13 lore raw
In reply to Joerg Roedel
Quoted 15 lines · Joerg Roedel

Hi,

here are a couple of iommu fixes and cleanups to fix compile errors and some warnings on ARM and PPC.

Regards,

Joerg

Joerg Roedel (4):
iommu: Make more drivers depend on COMPILE_TEST
iommu/exynos: Make driver depend on REGULATOR
iommu/omap: Print phys_addr_t using %pa
iommu/fsl: Use %pa to print phys_addr_t

Quoted 4 lines
 drivers/iommu/Kconfig      | 11 +++++++----
 drivers/iommu/fsl_pamu.c   |  4 ++--
 drivers/iommu/omap-iommu.c |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)

Applied these patches to their respective branches.