diff options
author | Rob Herring <robh@kernel.org> | 2018-07-09 11:41:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-10 11:22:35 -0400 |
commit | ac6bbf0cdf4206c517ac9789814c23e372ebce4d (patch) | |
tree | 48913d06c245b94e6e3f940b7de06a074978dcc7 | |
parent | 78f307be3e0bc85f25dc05baa60f7435a88c2abf (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.c | 2 | ||||
-rw-r--r-- | drivers/iommu/arm-smmu.c | 7 | ||||
-rw-r--r-- | drivers/iommu/exynos-iommu.c | 2 | ||||
-rw-r--r-- | drivers/iommu/ipmmu-vmsa.c | 3 | ||||
-rw-r--r-- | drivers/iommu/msm_iommu.c | 2 | ||||
-rw-r--r-- | drivers/iommu/of_iommu.c | 19 | ||||
-rw-r--r-- | drivers/iommu/qcom_iommu.c | 2 | ||||
-rw-r--r-- | drivers/iommu/rockchip-iommu.c | 2 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 2 | ||||
-rw-r--r-- | include/linux/of_iommu.h | 4 |
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 | }; |
2916 | module_platform_driver(arm_smmu_driver); | 2916 | module_platform_driver(arm_smmu_driver); |
2917 | 2917 | ||
2918 | IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3"); | ||
2919 | |||
2920 | MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations"); | 2918 | MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations"); |
2921 | MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>"); | 2919 | MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>"); |
2922 | MODULE_LICENSE("GPL v2"); | 2920 | MODULE_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 | }; |
2212 | module_platform_driver(arm_smmu_driver); | 2212 | module_platform_driver(arm_smmu_driver); |
2213 | 2213 | ||
2214 | IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1"); | ||
2215 | IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2"); | ||
2216 | IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400"); | ||
2217 | IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401"); | ||
2218 | IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500"); | ||
2219 | IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2"); | ||
2220 | |||
2221 | MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations"); | 2214 | MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations"); |
2222 | MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>"); | 2215 | MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>"); |
2223 | MODULE_LICENSE("GPL v2"); | 2216 | MODULE_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 | } |
1392 | core_initcall(exynos_iommu_init); | 1392 | core_initcall(exynos_iommu_init); |
1393 | |||
1394 | IOMMU_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) | |||
1108 | subsys_initcall(ipmmu_init); | 1108 | subsys_initcall(ipmmu_init); |
1109 | module_exit(ipmmu_exit); | 1109 | module_exit(ipmmu_exit); |
1110 | 1110 | ||
1111 | IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "renesas,ipmmu-vmsa"); | ||
1112 | IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795"); | ||
1113 | |||
1114 | MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU"); | 1111 | MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU"); |
1115 | MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>"); | 1112 | MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>"); |
1116 | MODULE_LICENSE("GPL v2"); | 1113 | MODULE_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) | |||
877 | subsys_initcall(msm_iommu_driver_init); | 877 | subsys_initcall(msm_iommu_driver_init); |
878 | module_exit(msm_iommu_driver_exit); | 878 | module_exit(msm_iommu_driver_exit); |
879 | 879 | ||
880 | IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu"); | ||
881 | |||
882 | MODULE_LICENSE("GPL v2"); | 880 | MODULE_LICENSE("GPL v2"); |
883 | MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>"); | 881 | MODULE_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 | ||
30 | static 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 | } |
99 | EXPORT_SYMBOL_GPL(of_get_dma_window); | 96 | EXPORT_SYMBOL_GPL(of_get_dma_window); |
100 | 97 | ||
101 | static 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 | |||
114 | static int of_iommu_xlate(struct device *dev, | 98 | static 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) | |||
945 | module_init(qcom_iommu_init); | 945 | module_init(qcom_iommu_init); |
946 | module_exit(qcom_iommu_exit); | 946 | module_exit(qcom_iommu_exit); |
947 | 947 | ||
948 | IOMMU_OF_DECLARE(qcom_iommu_dev, "qcom,msm-iommu-v1"); | ||
949 | |||
950 | MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations"); | 948 | MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations"); |
951 | MODULE_LICENSE("GPL v2"); | 949 | MODULE_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 | } |
1285 | subsys_initcall(rk_iommu_init); | 1285 | subsys_initcall(rk_iommu_init); |
1286 | 1286 | ||
1287 | IOMMU_OF_DECLARE(rk_iommu_of, "rockchip,iommu"); | ||
1288 | |||
1289 | MODULE_DESCRIPTION("IOMMU API for Rockchip"); | 1287 | MODULE_DESCRIPTION("IOMMU API for Rockchip"); |
1290 | MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>"); | 1288 | MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>"); |
1291 | MODULE_ALIAS("platform:rockchip-iommu"); | 1289 | MODULE_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 | ||
35 | extern 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 */ |