aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-07-09 11:41:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-10 11:22:35 -0400
commitac6bbf0cdf4206c517ac9789814c23e372ebce4d (patch)
tree48913d06c245b94e6e3f940b7de06a074978dcc7
parent78f307be3e0bc85f25dc05baa60f7435a88c2abf (diff)
iommu: Remove IOMMU_OF_DECLARE
Now that we use the driver core to stop deferred probe for missing drivers, IOMMU_OF_DECLARE can be removed. This is slightly less optimal than having a list of built-in drivers in that we'll now defer probe twice before giving up. This shouldn't have a significant impact on boot times as past discussions about deferred probe have given no evidence of deferred probe having a substantial impact. Cc: Robin Murphy <robin.murphy@arm.com> Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Rob Clark <robdclark@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Frank Rowand <frowand.list@gmail.com> Cc: linux-arm-kernel@lists.infradead.org Cc: iommu@lists.linux-foundation.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Cc: devicetree@vger.kernel.org Acked-by: Will Deacon <will.deacon@arm.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iommu/arm-smmu-v3.c2
-rw-r--r--drivers/iommu/arm-smmu.c7
-rw-r--r--drivers/iommu/exynos-iommu.c2
-rw-r--r--drivers/iommu/ipmmu-vmsa.c3
-rw-r--r--drivers/iommu/msm_iommu.c2
-rw-r--r--drivers/iommu/of_iommu.c19
-rw-r--r--drivers/iommu/qcom_iommu.c2
-rw-r--r--drivers/iommu/rockchip-iommu.c2
-rw-r--r--include/asm-generic/vmlinux.lds.h2
-rw-r--r--include/linux/of_iommu.h4
10 files changed, 1 insertions, 44 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 1d647104bccc..22bdabd3d8e0 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -2915,8 +2915,6 @@ static struct platform_driver arm_smmu_driver = {
2915}; 2915};
2916module_platform_driver(arm_smmu_driver); 2916module_platform_driver(arm_smmu_driver);
2917 2917
2918IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3");
2919
2920MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations"); 2918MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
2921MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>"); 2919MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
2922MODULE_LICENSE("GPL v2"); 2920MODULE_LICENSE("GPL v2");
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index f7a96bcf94a6..c73cfce1ccc0 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -2211,13 +2211,6 @@ static struct platform_driver arm_smmu_driver = {
2211}; 2211};
2212module_platform_driver(arm_smmu_driver); 2212module_platform_driver(arm_smmu_driver);
2213 2213
2214IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1");
2215IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2");
2216IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400");
2217IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401");
2218IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500");
2219IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2");
2220
2221MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations"); 2214MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
2222MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>"); 2215MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
2223MODULE_LICENSE("GPL v2"); 2216MODULE_LICENSE("GPL v2");
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 85879cfec52f..b128cb4372d3 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1390,5 +1390,3 @@ err_reg_driver:
1390 return ret; 1390 return ret;
1391} 1391}
1392core_initcall(exynos_iommu_init); 1392core_initcall(exynos_iommu_init);
1393
1394IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu");
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 40ae6e87cb88..f026aa16d5f1 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1108,9 +1108,6 @@ static void __exit ipmmu_exit(void)
1108subsys_initcall(ipmmu_init); 1108subsys_initcall(ipmmu_init);
1109module_exit(ipmmu_exit); 1109module_exit(ipmmu_exit);
1110 1110
1111IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "renesas,ipmmu-vmsa");
1112IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795");
1113
1114MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU"); 1111MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");
1115MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>"); 1112MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
1116MODULE_LICENSE("GPL v2"); 1113MODULE_LICENSE("GPL v2");
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 0d3350463a3f..27377742600d 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -877,7 +877,5 @@ static void __exit msm_iommu_driver_exit(void)
877subsys_initcall(msm_iommu_driver_init); 877subsys_initcall(msm_iommu_driver_init);
878module_exit(msm_iommu_driver_exit); 878module_exit(msm_iommu_driver_exit);
879 879
880IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu");
881
882MODULE_LICENSE("GPL v2"); 880MODULE_LICENSE("GPL v2");
883MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>"); 881MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>");
diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index 78ddf47dd67a..f7787e757244 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -27,9 +27,6 @@
27 27
28#define NO_IOMMU 1 28#define NO_IOMMU 1
29 29
30static const struct of_device_id __iommu_of_table_sentinel
31 __used __section(__iommu_of_table_end);
32
33/** 30/**
34 * of_get_dma_window - Parse *dma-window property and returns 0 if found. 31 * of_get_dma_window - Parse *dma-window property and returns 0 if found.
35 * 32 *
@@ -98,19 +95,6 @@ int of_get_dma_window(struct device_node *dn, const char *prefix, int index,
98} 95}
99EXPORT_SYMBOL_GPL(of_get_dma_window); 96EXPORT_SYMBOL_GPL(of_get_dma_window);
100 97
101static bool of_iommu_driver_present(struct device_node *np)
102{
103 /*
104 * If the IOMMU still isn't ready by the time we reach init, assume
105 * it never will be. We don't want to defer indefinitely, nor attempt
106 * to dereference __iommu_of_table after it's been freed.
107 */
108 if (system_state >= SYSTEM_RUNNING)
109 return false;
110
111 return of_match_node(&__iommu_of_table, np);
112}
113
114static int of_iommu_xlate(struct device *dev, 98static int of_iommu_xlate(struct device *dev,
115 struct of_phandle_args *iommu_spec) 99 struct of_phandle_args *iommu_spec)
116{ 100{
@@ -120,8 +104,7 @@ static int of_iommu_xlate(struct device *dev,
120 104
121 ops = iommu_ops_from_fwnode(fwnode); 105 ops = iommu_ops_from_fwnode(fwnode);
122 if ((ops && !ops->of_xlate) || 106 if ((ops && !ops->of_xlate) ||
123 !of_device_is_available(iommu_spec->np) || 107 !of_device_is_available(iommu_spec->np))
124 (!ops && !of_iommu_driver_present(iommu_spec->np)))
125 return NO_IOMMU; 108 return NO_IOMMU;
126 109
127 err = iommu_fwspec_init(dev, &iommu_spec->np->fwnode, ops); 110 err = iommu_fwspec_init(dev, &iommu_spec->np->fwnode, ops);
diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c
index fe88a4880d3a..b48aee82d14b 100644
--- a/drivers/iommu/qcom_iommu.c
+++ b/drivers/iommu/qcom_iommu.c
@@ -945,7 +945,5 @@ static void __exit qcom_iommu_exit(void)
945module_init(qcom_iommu_init); 945module_init(qcom_iommu_init);
946module_exit(qcom_iommu_exit); 946module_exit(qcom_iommu_exit);
947 947
948IOMMU_OF_DECLARE(qcom_iommu_dev, "qcom,msm-iommu-v1");
949
950MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations"); 948MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations");
951MODULE_LICENSE("GPL v2"); 949MODULE_LICENSE("GPL v2");
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 054cd2c8e9c8..de8d3bf91b23 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1284,8 +1284,6 @@ static int __init rk_iommu_init(void)
1284} 1284}
1285subsys_initcall(rk_iommu_init); 1285subsys_initcall(rk_iommu_init);
1286 1286
1287IOMMU_OF_DECLARE(rk_iommu_of, "rockchip,iommu");
1288
1289MODULE_DESCRIPTION("IOMMU API for Rockchip"); 1287MODULE_DESCRIPTION("IOMMU API for Rockchip");
1290MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>"); 1288MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>");
1291MODULE_ALIAS("platform:rockchip-iommu"); 1289MODULE_ALIAS("platform:rockchip-iommu");
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index e373e2e10f6a..f173b5f30dbe 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -218,7 +218,6 @@
218#define TIMER_OF_TABLES() OF_TABLE(CONFIG_TIMER_OF, timer) 218#define TIMER_OF_TABLES() OF_TABLE(CONFIG_TIMER_OF, timer)
219#define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip) 219#define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip)
220#define CLK_OF_TABLES() OF_TABLE(CONFIG_COMMON_CLK, clk) 220#define CLK_OF_TABLES() OF_TABLE(CONFIG_COMMON_CLK, clk)
221#define IOMMU_OF_TABLES() OF_TABLE(CONFIG_OF_IOMMU, iommu)
222#define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem) 221#define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem)
223#define CPU_METHOD_OF_TABLES() OF_TABLE(CONFIG_SMP, cpu_method) 222#define CPU_METHOD_OF_TABLES() OF_TABLE(CONFIG_SMP, cpu_method)
224#define CPUIDLE_METHOD_OF_TABLES() OF_TABLE(CONFIG_CPU_IDLE, cpuidle_method) 223#define CPUIDLE_METHOD_OF_TABLES() OF_TABLE(CONFIG_CPU_IDLE, cpuidle_method)
@@ -601,7 +600,6 @@
601 CLK_OF_TABLES() \ 600 CLK_OF_TABLES() \
602 RESERVEDMEM_OF_TABLES() \ 601 RESERVEDMEM_OF_TABLES() \
603 TIMER_OF_TABLES() \ 602 TIMER_OF_TABLES() \
604 IOMMU_OF_TABLES() \
605 CPU_METHOD_OF_TABLES() \ 603 CPU_METHOD_OF_TABLES() \
606 CPUIDLE_METHOD_OF_TABLES() \ 604 CPUIDLE_METHOD_OF_TABLES() \
607 KERNEL_DTB() \ 605 KERNEL_DTB() \
diff --git a/include/linux/of_iommu.h b/include/linux/of_iommu.h
index 4fa654e4b5a9..f3d40dd7bb66 100644
--- a/include/linux/of_iommu.h
+++ b/include/linux/of_iommu.h
@@ -32,8 +32,4 @@ static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
32 32
33#endif /* CONFIG_OF_IOMMU */ 33#endif /* CONFIG_OF_IOMMU */
34 34
35extern struct of_device_id __iommu_of_table;
36
37#define IOMMU_OF_DECLARE(name, compat) OF_DECLARE_1(iommu, name, compat, NULL)
38
39#endif /* __OF_IOMMU_H */ 35#endif /* __OF_IOMMU_H */