linux/arch
Andres Salomon cb8ab687c3 x86: ioremap ram check fix
bdd3cee2e4 (x86: ioremap(), extend check
to all RAM pages) breaks OLPC's ioremap call.  The ioremap that OLPC uses is:

        romsig = ioremap(0xffffffc0, 16);

The commit that breaks it is basically:

-       for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped &&
-            (pfn << PAGE_SHIFT) < last_addr; pfn++) {
+       for (pfn = phys_addr >> PAGE_SHIFT;
+                               (pfn << PAGE_SHIFT) < last_addr; pfn++) {
+

Previously, the 'pfn < max_pfn_mapped' check would've caused us to not
enter the loop.  Removing that check means we loop infinitely.  The
reason for that is because pfn is 0xfffff, and last_addr is 0xffffffcf.
The remaining check that is used to exit the loop is not sufficient;
when pfn<<PAGE_SHIFT is 0xfffff000, that is less than 0xffffffcf; when
we increment pfn and it overflows (pfn == 0x100000), pfn<<PAGE_SHIFT
ends up being 0.  That, of course, is less than last_addr.  In effect,
pfn<<PAGE_SHIFT is never lower than last_addr.

The simple fix for this is to limit the last_addr check to the PAGE_MASK;
a patch is below.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-04-30 23:15:35 +02:00
..
alpha alpha: use kbuild.h instead of macros in asm-offsets.c 2008-04-29 08:06:29 -07:00
arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-30 08:45:48 -07:00
avr32 avr32: use kbuild.h macros instead of defining macros in asm-offsets.c 2008-04-29 08:06:29 -07:00
blackfin i2c: Convert most new-style drivers to use module aliasing 2008-04-29 23:11:40 +02:00
cris cris: use non-racy method for /proc/system_profile creation 2008-04-29 08:06:21 -07:00
frv Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2008-04-30 11:52:52 -07:00
h8300 h8300: use kbuild.h instead of defining macros in asm-offsets.c 2008-04-29 08:06:30 -07:00
ia64 tty: The big operations rework 2008-04-30 08:29:47 -07:00
m32r Generic semaphore implementation 2008-04-17 10:42:34 -04:00
m68k m68k: Export empty_zero_page for ZERO_PAGE usage in modules. 2008-04-29 08:11:12 -04:00
m68knommu m68k/m68kmmu: use kbuild.h instead of defining macros in asm-offsets.c 2008-04-29 08:06:30 -07:00
mips Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2008-04-30 11:52:52 -07:00
mn10300 mn10300: use kbuild.h instead of defining macros in asm-offsets.c 2008-04-29 08:06:30 -07:00
parisc parisc: use kbuild.h instead of defining macros in asm-offsets.c 2008-04-29 08:06:30 -07:00
powerpc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-04-30 08:37:40 -07:00
ppc Basic braille screen reader support 2008-04-30 08:29:52 -07:00
s390 Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-04-30 08:38:30 -07:00
sh i2c: Convert most new-style drivers to use module aliasing 2008-04-29 23:11:40 +02:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-04-30 08:46:16 -07:00
sparc64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-04-30 08:46:16 -07:00
um proc: remove proc_root from drivers 2008-04-29 08:06:18 -07:00
v850 v850: use kbuild.h instead of defining macros in asm-offsets.c 2008-04-29 08:06:30 -07:00
x86 x86: ioremap ram check fix 2008-04-30 23:15:35 +02:00
xtensa xtensa: use kbuild.h macros instead of defining them in asm-offsets.c 2008-04-29 08:06:29 -07:00
.gitignore arch: Ignore arch/i386 and arch/x86_64 2008-01-19 21:29:39 -08:00
Kconfig dma: add dma_*map*_attrs() interfaces 2008-04-29 08:06:11 -07:00