[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimwNivgL1cxrQnmoOQj_FmSVznHMuFwHO365wRU@mail.gmail.com>
Date: Sat, 9 Oct 2010 12:32:05 +0300
From: Felipe Contreras <felipe.contreras@...il.com>
To: Greg KH <greg@...ah.com>
Cc: Nicolas Pitre <nico@...xnic.net>,
Russell King - ARM Linux <linux@....linux.org.uk>,
linux-main <linux-kernel@...r.kernel.org>,
linux-arm <linux-arm-kernel@...ts.infradead.org>,
Arnd Hannemann <arnd@...dnet.de>,
Han Jonghun <jonghun79.han@...il.com>,
"Uwe Kleine-K?nig" <u.kleine-koenig@...gutronix.de>,
Hemant Pedanekar <hemantp@...com>
Subject: Re: [PATCH] ARM: allow, but warn, when issuing ioremap() on RAM
On Sat, Oct 9, 2010 at 6:04 AM, Greg KH <greg@...ah.com> wrote:
> On Fri, Oct 08, 2010 at 10:41:42PM -0400, Nicolas Pitre wrote:
>> 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;
>>
>
> That looks good to me, anyone else object to this?
I object; this is still breaking drivers.
The decision was to don't allow ioremap() on RAM for all ARM, I agree
with that decision, there's no point in an API to works differently on
different ARM chips. Moreover, this would be more in line with x86's
ioremap().
All that is needed IMO is a grace period... Before this is activated
for real, the warning should happen on all drivers.
--
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists