|
|
4f94981 |
From: Thierry Reding <treding@nvidia.com>
|
|
|
4f94981 |
Date: Fri, 6 Feb 2015 11:44:05 +0100
|
|
|
4f94981 |
Subject: [PATCH] iommu/exynos: Play nice in multi-platform builds
|
|
|
4f94981 |
|
|
|
4f94981 |
The Exynos System MMU driver unconditionally executes code and registers
|
|
|
4f94981 |
a struct iommu_ops with the platform bus irrespective of whether it runs
|
|
|
4f94981 |
on an Exynos SoC or not. This causes problems in multi-platform kernels
|
|
|
4f94981 |
where drivers for other SoCs will no longer be able to register their
|
|
|
4f94981 |
own struct iommu_ops or even try to use a struct iommu_ops for an IOMMU
|
|
|
4f94981 |
that obviously isn't there.
|
|
|
4f94981 |
|
|
|
4f94981 |
The smallest fix I could think of is to check for the existence of any
|
|
|
4f94981 |
Exynos System MMU devices in the device tree and skip initialization
|
|
|
4f94981 |
otherwise.
|
|
|
4f94981 |
|
|
|
4f94981 |
This fixes a problem on Tegra20 where the DRM driver will try to use the
|
|
|
4f94981 |
obviously non-existent Exynos System MMU.
|
|
|
4f94981 |
|
|
|
4f94981 |
Reported-by: Nicolas Chauvet <kwizart@gmail.com>
|
|
|
4f94981 |
Cc: Kukjin Kim <kgene@kernel.org>
|
|
|
4f94981 |
Signed-off-by: Thierry Reding <treding@nvidia.com>
|
|
|
4f94981 |
Signed-off-by: Joerg Roedel <jroedel@suse.de>
|
|
|
4f94981 |
---
|
|
|
4f94981 |
drivers/iommu/exynos-iommu.c | 7 +++++++
|
|
|
4f94981 |
1 file changed, 7 insertions(+)
|
|
|
4f94981 |
|
|
|
4f94981 |
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
|
|
|
4f94981 |
index 7ce52737c7a1..dc14fec4ede1 100644
|
|
|
4f94981 |
--- a/drivers/iommu/exynos-iommu.c
|
|
|
4f94981 |
+++ b/drivers/iommu/exynos-iommu.c
|
|
|
4f94981 |
@@ -1186,8 +1186,15 @@ static const struct iommu_ops exynos_iommu_ops = {
|
|
|
4f94981 |
|
|
|
4f94981 |
static int __init exynos_iommu_init(void)
|
|
|
4f94981 |
{
|
|
|
4f94981 |
+ struct device_node *np;
|
|
|
4f94981 |
int ret;
|
|
|
4f94981 |
|
|
|
4f94981 |
+ np = of_find_matching_node(NULL, sysmmu_of_match);
|
|
|
4f94981 |
+ if (!np)
|
|
|
4f94981 |
+ return 0;
|
|
|
4f94981 |
+
|
|
|
4f94981 |
+ of_node_put(np);
|
|
|
4f94981 |
+
|
|
|
4f94981 |
lv2table_kmem_cache = kmem_cache_create("exynos-iommu-lv2table",
|
|
|
4f94981 |
LV2TABLE_SIZE, LV2TABLE_SIZE, 0, NULL);
|
|
|
4f94981 |
if (!lv2table_kmem_cache) {
|
|
|
4f94981 |
--
|
|
|
4f94981 |
2.1.0
|
|
|
4f94981 |
|