]> Pileus Git - ~andy/linux/commitdiff
parisc: fix kernel BUG at arch/parisc/include/asm/mmzone.h:50 (part 2)
authorHelge Deller <deller@gmx.de>
Wed, 5 Jun 2013 20:50:01 +0000 (20:50 +0000)
committerHelge Deller <deller@gmx.de>
Tue, 18 Jun 2013 18:20:21 +0000 (20:20 +0200)
Make sure that we really return -1 (instead of 0x00ff) as node id for
page frame numbers which are not physically available.

This finally fixes the kernel panic when running
cat /proc/kpageflags /proc/kpagecount.

Theoretically this patch now limits the number of physical memory ranges
to 127 instead of 254, but currently we have MAX_PHYSMEM_RANGES
hardcoded to 8 which is sufficient for all existing parisc machines.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/mmzone.h
arch/parisc/mm/init.c

index cc50d33b7b881b7c57f7a46c125a56860840e514..b6b34a0987e7d7aafb42cd47d0c3b8f888007bd8 100644 (file)
@@ -27,7 +27,7 @@ extern struct node_map_data node_data[];
 
 #define PFNNID_SHIFT (30 - PAGE_SHIFT)
 #define PFNNID_MAP_MAX  512     /* support 512GB */
-extern unsigned char pfnnid_map[PFNNID_MAP_MAX];
+extern signed char pfnnid_map[PFNNID_MAP_MAX];
 
 #ifndef CONFIG_64BIT
 #define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT))
@@ -46,7 +46,7 @@ static inline int pfn_to_nid(unsigned long pfn)
        i = pfn >> PFNNID_SHIFT;
        BUG_ON(i >= ARRAY_SIZE(pfnnid_map));
 
-       return (int)pfnnid_map[i];
+       return pfnnid_map[i];
 }
 
 static inline int pfn_valid(int pfn)
index 1c965642068b48d6b7102a5b6adb365f321f73e6..505b56c6b9b9c6dafa9df67b775c44eb1ebf1867 100644 (file)
@@ -47,7 +47,7 @@ pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data..vm0.pt
 
 #ifdef CONFIG_DISCONTIGMEM
 struct node_map_data node_data[MAX_NUMNODES] __read_mostly;
-unsigned char pfnnid_map[PFNNID_MAP_MAX] __read_mostly;
+signed char pfnnid_map[PFNNID_MAP_MAX] __read_mostly;
 #endif
 
 static struct resource data_resource = {