提交 892d7aad 编写于 作者: R Robin Murphy 提交者: Joerg Roedel

iommu/msm: Claim bus ops on probe

Since the MSM IOMMU driver now probes via DT exclusively rather than
platform data, dependent masters should be deferred until the IOMMU
itself is ready. Thus we can do away with the early initialisation
hook to unconditionally claim the bus ops, and instead do that only
once an IOMMU is actually probed. Furthermore, this should also make
the driver safe for multiplatform kernels on non-MSM SoCs.
Reviewed-by: NSricharan R <sricharan@codeaurora.org>
Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
Signed-off-by: NJoerg Roedel <jroedel@suse.de>
上级 9ae9df03
...@@ -823,6 +823,8 @@ static int msm_iommu_probe(struct platform_device *pdev) ...@@ -823,6 +823,8 @@ static int msm_iommu_probe(struct platform_device *pdev)
goto fail; goto fail;
} }
bus_set_iommu(&platform_bus_type, &msm_iommu_ops);
pr_info("device mapped at %p, irq %d with %d ctx banks\n", pr_info("device mapped at %p, irq %d with %d ctx banks\n",
iommu->base, iommu->irq, iommu->ncb); iommu->base, iommu->irq, iommu->ncb);
...@@ -875,19 +877,7 @@ static void __exit msm_iommu_driver_exit(void) ...@@ -875,19 +877,7 @@ static void __exit msm_iommu_driver_exit(void)
subsys_initcall(msm_iommu_driver_init); subsys_initcall(msm_iommu_driver_init);
module_exit(msm_iommu_driver_exit); module_exit(msm_iommu_driver_exit);
static int __init msm_iommu_init(void) IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu", NULL);
{
bus_set_iommu(&platform_bus_type, &msm_iommu_ops);
return 0;
}
static int __init msm_iommu_of_setup(struct device_node *np)
{
msm_iommu_init();
return 0;
}
IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu", msm_iommu_of_setup);
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>"); MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>");
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册