[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180726211916.10264-1-digetx@gmail.com>
Date: Fri, 27 Jul 2018 00:19:16 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Joerg Roedel <joro@...tes.org>,
Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
Marc Dietrich <marvin24@....de>
Cc: iommu@...ts.linux-foundation.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v1] iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA
This fixes kernel crashing on NVIDIA Tegra if kernel is compiled in
a multiplatform configuration and IPMMU-VMSA driver is enabled.
Cc: <stable@...r.kernel.org> # v3.20+
Signed-off-by: Dmitry Osipenko <digetx@...il.com>
---
drivers/iommu/ipmmu-vmsa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 9e8495762bc8..78c50db9cd71 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1109,12 +1109,19 @@ static struct platform_driver ipmmu_driver = {
static int __init ipmmu_init(void)
{
+ struct device_node *np;
static bool setup_done;
int ret;
if (setup_done)
return 0;
+ np = of_find_matching_node(NULL, ipmmu_of_ids);
+ if (!np)
+ return 0;
+
+ of_node_put(np);
+
ret = platform_driver_register(&ipmmu_driver);
if (ret < 0)
return ret;
--
2.18.0
Powered by blists - more mailing lists