summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-11-07 15:26:18 +0000
committerWill Deacon <will.deacon@arm.com>2014-11-14 14:41:39 +0000
commit0e7d37adbe45404a76d05d4ef11544f23cf639dd (patch)
tree0081582c0738c99ed7f073a967751bdf126887ee /drivers/iommu
parentcfdeec22e459e3c5081c8fc6d956c8ee68943397 (diff)
downloadblackbird-op-linux-0e7d37adbe45404a76d05d4ef11544f23cf639dd.tar.gz
blackbird-op-linux-0e7d37adbe45404a76d05d4ef11544f23cf639dd.zip
iommu/arm-smmu: Play nice on non-ARM/SMMU systems
Currently the driver registers IOMMU bus operations for all busses even if no ARM SMMU is present on a system. Depending on the driver probing order this prevents the driver for the real IOMMU to register itself as the bus-wide IOMMU. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/arm-smmu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index c8fc02f111c5..217581469f79 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -2075,8 +2075,20 @@ static struct platform_driver arm_smmu_driver = {
static int __init arm_smmu_init(void)
{
+ struct device_node *np;
int ret;
+ /*
+ * Play nice with systems that don't have an ARM SMMU by checking that
+ * an ARM SMMU exists in the system before proceeding with the driver
+ * and IOMMU bus operation registration.
+ */
+ np = of_find_matching_node(NULL, arm_smmu_of_match);
+ if (!np)
+ return 0;
+
+ of_node_put(np);
+
ret = platform_driver_register(&arm_smmu_driver);
if (ret)
return ret;
OpenPOWER on IntegriCloud