From 3edd9628c0206b4239e2bcec977ca3b4e618a199 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 21 Jan 2011 17:04:36 -0800 Subject: [PATCH] ARM: tegra: Prevent dynamically ioremapping device io memory Change-Id: I893a42bd773b1acdf2b83f8602fe1aa6a8ea6741 Signed-off-by: Colin Cross --- arch/arm/mach-tegra/io.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c index 0856818e92da..a1674da7dd81 100644 --- a/arch/arm/mach-tegra/io.c +++ b/arch/arm/mach-tegra/io.c @@ -86,8 +86,20 @@ void __init tegra_map_common_io(void) void __iomem *tegra_ioremap(unsigned long p, size_t size, unsigned int type) { void __iomem *v = IO_ADDRESS(p); - if (v == NULL) + + /* + * __arm_ioremap fails to set the domain of ioremapped memory + * correctly, only use it on physical memory. + */ + if (v == NULL && p < SZ_1G) v = __arm_ioremap(p, size, type); + + /* + * If the physical address was not physical memory or statically + * mapped, there's nothing we can do to map it safely. + */ + BUG_ON(v == NULL); + return v; } EXPORT_SYMBOL(tegra_ioremap); -- 2.34.1