jwboyer pushed to kernel (f21). "ARMv7: add patches to fix crash on boot for some devices on multiplatform (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Mar 26 13:43:30 UTC 2015


>From 4f9498146c2be73c05df0ad08b427cc1ab0bc173 Mon Sep 17 00:00:00 2001
From: Nicolas Chauvet <kwizart at gmail.com>
Date: Wed, 25 Mar 2015 22:04:28 +0100
Subject: ARMv7: add patches to fix crash on boot for some devices on
 multiplatform

This patch backport the previous commit from pbrobinson in devel
to the f21 branch (without the changelog entry)
Tested with fedpkg prep to verify that the patches applies

(Reworked to cherry-pick the patches directly from upstream instead of using
 mailing list patches)

diff --git a/iommu-exynos-Play-nice-in-multi-platform-builds.patch b/iommu-exynos-Play-nice-in-multi-platform-builds.patch
new file mode 100644
index 0000000..950eebd
--- /dev/null
+++ b/iommu-exynos-Play-nice-in-multi-platform-builds.patch
@@ -0,0 +1,49 @@
+From: Thierry Reding <treding at nvidia.com>
+Date: Fri, 6 Feb 2015 11:44:05 +0100
+Subject: [PATCH] iommu/exynos: Play nice in multi-platform builds
+
+The Exynos System MMU driver unconditionally executes code and registers
+a struct iommu_ops with the platform bus irrespective of whether it runs
+on an Exynos SoC or not. This causes problems in multi-platform kernels
+where drivers for other SoCs will no longer be able to register their
+own struct iommu_ops or even try to use a struct iommu_ops for an IOMMU
+that obviously isn't there.
+
+The smallest fix I could think of is to check for the existence of any
+Exynos System MMU devices in the device tree and skip initialization
+otherwise.
+
+This fixes a problem on Tegra20 where the DRM driver will try to use the
+obviously non-existent Exynos System MMU.
+
+Reported-by: Nicolas Chauvet <kwizart at gmail.com>
+Cc: Kukjin Kim <kgene at kernel.org>
+Signed-off-by: Thierry Reding <treding at nvidia.com>
+Signed-off-by: Joerg Roedel <jroedel at suse.de>
+---
+ drivers/iommu/exynos-iommu.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
+index 7ce52737c7a1..dc14fec4ede1 100644
+--- a/drivers/iommu/exynos-iommu.c
++++ b/drivers/iommu/exynos-iommu.c
+@@ -1186,8 +1186,15 @@ static const struct iommu_ops exynos_iommu_ops = {
+ 
+ static int __init exynos_iommu_init(void)
+ {
++	struct device_node *np;
+ 	int ret;
+ 
++	np = of_find_matching_node(NULL, sysmmu_of_match);
++	if (!np)
++		return 0;
++
++	of_node_put(np);
++
+ 	lv2table_kmem_cache = kmem_cache_create("exynos-iommu-lv2table",
+ 				LV2TABLE_SIZE, LV2TABLE_SIZE, 0, NULL);
+ 	if (!lv2table_kmem_cache) {
+-- 
+2.1.0
+
diff --git a/iommu-omap-Play-nice-in-multi-platform-builds.patch b/iommu-omap-Play-nice-in-multi-platform-builds.patch
new file mode 100644
index 0000000..8d57e42
--- /dev/null
+++ b/iommu-omap-Play-nice-in-multi-platform-builds.patch
@@ -0,0 +1,49 @@
+From: Thierry Reding <treding at nvidia.com>
+Date: Fri, 6 Feb 2015 11:44:06 +0100
+Subject: [PATCH] iommu/omap: Play nice in multi-platform builds
+
+The OMAP IOMMU driver unconditionally executes code and registers a
+struct iommu_ops with the platform bus irrespective of whether it runs
+on an OMAP SoC or not. This causes problems in multi-platform kernels
+where drivers for other SoCs will no longer be able to register their
+own struct iommu_ops or even try to use a struct iommu_ops for an IOMMU
+that obviously isn't there.
+
+The smallest fix I could think of is to check for the existence of any
+OMAP IOMMU devices in the device tree and skip initialization otherwise.
+
+This fixes a problem on Tegra20 where the DRM driver will try to use the
+obviously non-existent OMAP IOMMU.
+
+Reported-by: Nicolas Chauvet <kwizart at gmail.com>
+Cc: Tony Lindgren <tony at atomide.com>
+Cc: Suman Anna <s-anna at ti.com>
+Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Thierry Reding <treding at nvidia.com>
+Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Joerg Roedel <jroedel at suse.de>
+---
+ drivers/iommu/omap-iommu.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
+index bbb7dcef02d3..19db0b684b7f 100644
+--- a/drivers/iommu/omap-iommu.c
++++ b/drivers/iommu/omap-iommu.c
+@@ -1376,6 +1376,13 @@ static int __init omap_iommu_init(void)
+ 	struct kmem_cache *p;
+ 	const unsigned long flags = SLAB_HWCACHE_ALIGN;
+ 	size_t align = 1 << 10; /* L2 pagetable alignement */
++	struct device_node *np;
++
++	np = of_find_matching_node(NULL, omap_iommu_of_match);
++	if (!np)
++		return 0;
++
++	of_node_put(np);
+ 
+ 	p = kmem_cache_create("iopte_cache", IOPTE_TABLE_SIZE, align, flags,
+ 			      iopte_cachep_ctor);
+-- 
+2.1.0
+
diff --git a/iommu-rockchip-Play-nice-in-multi-platform-builds.patch b/iommu-rockchip-Play-nice-in-multi-platform-builds.patch
new file mode 100644
index 0000000..0050b89
--- /dev/null
+++ b/iommu-rockchip-Play-nice-in-multi-platform-builds.patch
@@ -0,0 +1,52 @@
+From: Thierry Reding <treding at nvidia.com>
+Date: Fri, 6 Feb 2015 11:44:07 +0100
+Subject: [PATCH] iommu/rockchip: Play nice in multi-platform builds
+
+The Rockchip IOMMU driver unconditionally executes code and registers a
+struct iommu_ops with the platform bus irrespective of whether it runs
+on a Rockchip SoC or not. This causes problems in multi-platform kernels
+where drivers for other SoCs will no longer be able to register their
+own struct iommu_ops or even try to use a struct iommu_ops for an IOMMU
+that obviously isn't there.
+
+The smallest fix I could think of is to check for the existence of any
+Rockchip IOMMU devices in the device tree and skip initialization
+otherwise.
+
+This fixes a problem on Tegra20 where the DRM driver will try to use the
+obviously non-existent Rockchip IOMMU.
+
+Reported-by: Nicolas Chauvet <kwizart at gmail.com>
+Cc: Heiko Stuebner <heiko at sntech.de>
+Cc: Daniel Kurtz <djkurtz at chromium.org>
+Reviewed-by: Heiko Stuebner <heiko at sntech.de>
+Tested-by: Heiko Stuebner <heiko at sntech.de>
+Signed-off-by: Thierry Reding <treding at nvidia.com>
+Signed-off-by: Joerg Roedel <jroedel at suse.de>
+---
+ drivers/iommu/rockchip-iommu.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
+index 6a8b1ec4a48a..9f74fddcd304 100644
+--- a/drivers/iommu/rockchip-iommu.c
++++ b/drivers/iommu/rockchip-iommu.c
+@@ -1015,8 +1015,15 @@ static struct platform_driver rk_iommu_driver = {
+ 
+ static int __init rk_iommu_init(void)
+ {
++	struct device_node *np;
+ 	int ret;
+ 
++	np = of_find_matching_node(NULL, rk_iommu_dt_ids);
++	if (!np)
++		return 0;
++
++	of_node_put(np);
++
+ 	ret = bus_set_iommu(&platform_bus_type, &rk_iommu_ops);
+ 	if (ret)
+ 		return ret;
+-- 
+2.1.0
+
diff --git a/kernel.spec b/kernel.spec
index 4d37c11..97ac5a6 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -590,6 +590,11 @@ Patch21026: pinctrl-pinctrl-single-must-be-initialized-early.patch
 
 Patch21028: arm-i.MX6-Utilite-device-dtb.patch
 
+# IOMMU crash fixes - https://lists.linuxfoundation.org/pipermail/iommu/2015-February/012329.html
+Patch21030: iommu-omap-Play-nice-in-multi-platform-builds.patch
+Patch21031: iommu-exynos-Play-nice-in-multi-platform-builds.patch
+Patch21032: iommu-rockchip-Play-nice-in-multi-platform-builds.patch
+
 Patch21100: arm-highbank-l2-reverts.patch
 
 #rhbz 754518
@@ -1246,6 +1251,10 @@ ApplyPatch pinctrl-pinctrl-single-must-be-initialized-early.patch
 
 ApplyPatch arm-i.MX6-Utilite-device-dtb.patch
 
+ApplyPatch iommu-omap-Play-nice-in-multi-platform-builds.patch
+ApplyPatch iommu-exynos-Play-nice-in-multi-platform-builds.patch
+ApplyPatch iommu-rockchip-Play-nice-in-multi-platform-builds.patch
+
 ApplyPatch arm-highbank-l2-reverts.patch
 
 #
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/kernel.git/commit/?h=f21&id=4f9498146c2be73c05df0ad08b427cc1ab0bc173


More information about the scm-commits mailing list