Revert "MIPS: page.h: Provide more readable definition for PAGE_MASK." [Linux 3.9]

This Linux kernel change "Revert “MIPS: page.h: Provide more readable definition for PAGE_MASK.”" is included in the Linux 3.9 release. This change is authored by Ralf Baechle <ralf [at] linux-mips.org> on Mon Apr 22 17:57:54 2013 +0200. The commit for this change in Linux stable tree is 3b5e50e (patch).

Revert "MIPS: page.h: Provide more readable definition for PAGE_MASK."

This reverts commit c17a6554782ad531f4713b33fd6339ba67ef6391.

Manuel Lauss writes:

lmo commit c17a6554 (MIPS: page.h: Provide more readable definition for
PAGE_MASK) apparently breaks ioremap of 36-bit addresses on my Alchemy
systems (PCI and PCMCIA) The reason is that in arch/mips/mm/ioremap.c
line 157  (phys_addr &= PAGE_MASK) bits 32-35 are cut off.  Seems the
new PAGE_MASK is explicitly 32bit, or one could make it signed instead
of unsigned long.

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/mips/include/asm/page.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 99fc547..eab99e5 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -31,7 +31,7 @@
 #define PAGE_SHIFT 16
 #endif
 #define PAGE_SIZE  (_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK  (~(PAGE_SIZE - 1))
+#define PAGE_MASK  (~((1 << PAGE_SHIFT) - 1))

 #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
 #define HPAGE_SHIFT    (PAGE_SHIFT + PAGE_SHIFT - 3)

Leave a Reply

Your email address will not be published. Required fields are marked *