On Sat, 9 Oct 2010, Russell King - ARM Linux wrote:
I think that the real issue here is to avoid breaking those drivers
which were using this legitimately. So what about this compromize
instead:
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 99627d3..4f071e4 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -201,6 +201,15 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
return NULL;
+ /*
+ * Warn if RAM is mapped to discourage this usage. Let's forbid it
+ * outright on ARMv6+ where this became architecturally undefined
+ * in theory and causes memory corruption in practice.
+ */
+ if (WARN_ON(pfn_valid(pfn)))
+ if (__LINUX_ARM_ARCH__ >= 6)
+ return NULL;
+
type = get_mem_type(mtype);
if (!type)
return NULL;
Nicolas
--