diff mbox

[RFC,v2,6/7] arm: call iommu_init before of_platform_populate

Message ID 1409680587-29818-7-git-send-email-will.deacon@arm.com
State New
Headers show

Commit Message

Will Deacon Sept. 2, 2014, 5:56 p.m. UTC
We need to ensure that the IOMMUs in the system have a chance to perform
some basic initialisation before we start adding masters to them.

This patch adds a call to of_iommu_init before of_platform_populate.

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/kernel/setup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Arnd Bergmann Sept. 2, 2014, 6:13 p.m. UTC | #1
On Tuesday 02 September 2014 18:56:26 Will Deacon wrote:
> @@ -803,9 +804,11 @@ static int __init customize_machine(void)
>         if (machine_desc->init_machine)
>                 machine_desc->init_machine();
>  #ifdef CONFIG_OF
> -       else
> +       else {
> +               of_iommu_init();
>                 of_platform_populate(NULL, of_default_bus_match_table,
>                                         NULL, NULL);
> +       }
>  #endif
>         return 0;
>  }

I think it would be better to not have this depend on the presence
of an init_machine callback. Why not move of_iommu_init() in front
of the if()? It shouldn't do anything unless we have an iommu
driver that we should be using.

	Arnd
diff mbox

Patch

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 84db893dedc2..38a0203523af 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -18,6 +18,7 @@ 
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/screen_info.h>
+#include <linux/of_iommu.h>
 #include <linux/of_platform.h>
 #include <linux/init.h>
 #include <linux/kexec.h>
@@ -803,9 +804,11 @@  static int __init customize_machine(void)
 	if (machine_desc->init_machine)
 		machine_desc->init_machine();
 #ifdef CONFIG_OF
-	else
+	else {
+		of_iommu_init();
 		of_platform_populate(NULL, of_default_bus_match_table,
 					NULL, NULL);
+	}
 #endif
 	return 0;
 }