aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2018-01-09 11:17:25 -0500
committerJoerg Roedel <jroedel@suse.de>2018-01-17 09:25:49 -0500
commit892d7aaddb24b0d3eaf05534ed29a264d3b52646 (patch)
tree1ce473d014170ed9b326788cc12d7f0887abe6e8
parent9ae9df035c274c89b7fe3dbc74cbe2fa63386668 (diff)
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: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/iommu/msm_iommu.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 04f4d51ffacb..dda1ce87a070 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -823,6 +823,8 @@ static int msm_iommu_probe(struct platform_device *pdev)
823 goto fail; 823 goto fail;
824 } 824 }
825 825
826 bus_set_iommu(&platform_bus_type, &msm_iommu_ops);
827
826 pr_info("device mapped at %p, irq %d with %d ctx banks\n", 828 pr_info("device mapped at %p, irq %d with %d ctx banks\n",
827 iommu->base, iommu->irq, iommu->ncb); 829 iommu->base, iommu->irq, iommu->ncb);
828 830
@@ -875,19 +877,7 @@ static void __exit msm_iommu_driver_exit(void)
875subsys_initcall(msm_iommu_driver_init); 877subsys_initcall(msm_iommu_driver_init);
876module_exit(msm_iommu_driver_exit); 878module_exit(msm_iommu_driver_exit);
877 879
878static int __init msm_iommu_init(void) 880IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu", NULL);
879{
880 bus_set_iommu(&platform_bus_type, &msm_iommu_ops);
881 return 0;
882}
883
884static int __init msm_iommu_of_setup(struct device_node *np)
885{
886 msm_iommu_init();
887 return 0;
888}
889
890IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu", msm_iommu_of_setup);
891 881
892MODULE_LICENSE("GPL v2"); 882MODULE_LICENSE("GPL v2");
893MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>"); 883MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>");