All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iommu/msm: Claim bus ops on probe
@ 2018-01-08 18:42 ` Robin Murphy
  0 siblings, 0 replies; 18+ messages in thread
From: Robin Murphy @ 2018-01-08 18:42 UTC (permalink / raw)
  To: alex.williamson-H+wXaHxf7aLQT0dZR+AlfA, joro-zLv9SwRftAIdnm+yROfE0A
  Cc: srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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.

Signed-off-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
---
 drivers/iommu/msm_iommu.c | 16 +++-------------
 1 file 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)
 		goto fail;
 	}
 
+	bus_set_iommu(&platform_bus_type, &msm_iommu_ops);
+
 	pr_info("device mapped at %p, irq %d with %d ctx banks\n",
 		iommu->base, iommu->irq, iommu->ncb);
 
@@ -875,19 +877,7 @@ static void __exit msm_iommu_driver_exit(void)
 subsys_initcall(msm_iommu_driver_init);
 module_exit(msm_iommu_driver_exit);
 
-static int __init msm_iommu_init(void)
-{
-	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);
+IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu", NULL);
 
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Stepan Moskovchenko <stepanm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>");
-- 
2.13.4.dirty

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-01-17 14:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-08 18:42 [PATCH 1/2] iommu/msm: Claim bus ops on probe Robin Murphy
2018-01-08 18:42 ` Robin Murphy
     [not found] ` <f1a506337bf602c54f4d6d417c14ca556a5f3674.1515436860.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2018-01-08 18:42   ` [PATCH 2/2] iommu: Clean up of_iommu_init_fn Robin Murphy
2018-01-08 18:42     ` Robin Murphy
     [not found]     ` <1eb597bb451da7e723b83369d5dc6ee478e802f5.1515436860.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2018-01-09  6:19       ` Sricharan R
2018-01-09  6:19         ` Sricharan R
2018-01-09  6:04   ` [PATCH 1/2] iommu/msm: Claim bus ops on probe Sricharan R
2018-01-09  6:04     ` Sricharan R
2018-01-17 13:33   ` Joerg Roedel
2018-01-17 13:33     ` Joerg Roedel
     [not found]     ` <20180117133331.vidtyduiu7zr3fwc-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2018-01-17 13:39       ` Robin Murphy
2018-01-17 13:39         ` Robin Murphy
2018-01-17 13:53         ` Joerg Roedel
2018-01-17 13:53           ` Joerg Roedel
     [not found]           ` <20180117135356.GQ28161-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2018-01-17 14:05             ` Robin Murphy
2018-01-17 14:05               ` Robin Murphy
     [not found]               ` <fc884e48-bf80-23a7-8275-209950e0ef34-5wv7dgnIgG8@public.gmane.org>
2018-01-17 14:27                 ` Joerg Roedel
2018-01-17 14:27                   ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.