All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/of: Only do IOMMU lookup for available ones
@ 2018-01-03  6:09 Jeffy Chen
  2018-01-08 11:45   ` Robin Murphy
  2018-01-17 13:28 ` Joerg Roedel
  0 siblings, 2 replies; 8+ messages in thread
From: Jeffy Chen @ 2018-01-03  6:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: jcliang, tfiga, Jeffy Chen, iommu, Joerg Roedel

The for_each_matching_node_and_match() would return every matching
nodes including unavailable ones.

It's pointless to init unavailable IOMMUs, so add a sanity check to
avoid that.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

 drivers/iommu/of_iommu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index 50947ebb6d17..6f7456caa30d 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -240,6 +240,9 @@ static int __init of_iommu_init(void)
 	for_each_matching_node_and_match(np, matches, &match) {
 		const of_iommu_init_fn init_fn = match->data;
 
+		if (!of_device_is_available(np))
+			continue;
+
 		if (init_fn && init_fn(np))
 			pr_err("Failed to initialise IOMMU %pOF\n", np);
 	}
-- 
2.11.0

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-03  6:09 [PATCH] iommu/of: Only do IOMMU lookup for available ones Jeffy Chen
2018-01-08 11:45 ` Robin Murphy
2018-01-08 11:45   ` Robin Murphy
2018-01-17 13:28 ` Joerg Roedel
2018-01-18 14:41   ` Will Deacon
2018-01-18 14:41     ` Will Deacon
2018-01-18 14:58     ` JeffyChen
2018-01-18 14:58       ` JeffyChen

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.