From a2f3aa02576632cdb60bd3de1f4bf55e9ac65604 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Wed, 10 Jan 2007 23:15:30 -0800 Subject: [PATCH] Fix sparsemem on Cell Fix an oops experienced on the Cell architecture when init-time functions, early_*(), are called at runtime. It alters the call paths to make sure that the callers explicitly say whether the call is being made on behalf of a hotplug even, or happening at boot-time. It has been compile tested on ppc64, ia64, s390, i386 and x86_64. Acked-by: Arnd Bergmann Signed-off-by: Dave Hansen Cc: Yasunori Goto Acked-by: Andy Whitcroft Cc: Christoph Lameter Cc: Martin Schwidefsky Acked-by: Heiko Carstens Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mm.h | 3 ++- include/linux/mmzone.h | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/mm.h b/include/linux/mm.h index a17b147c61e..76912231af4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -978,7 +978,8 @@ extern int early_pfn_to_nid(unsigned long pfn); #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ extern void set_dma_reserve(unsigned long new_dma_reserve); -extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); +extern void memmap_init_zone(unsigned long, int, unsigned long, + unsigned long, enum memmap_context); extern void setup_per_zone_pages_min(void); extern void mem_init(void); extern void show_mem(void); diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e339a7345f2..b262f47961f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -450,9 +450,13 @@ void build_all_zonelists(void); void wakeup_kswapd(struct zone *zone, int order); int zone_watermark_ok(struct zone *z, int order, unsigned long mark, int classzone_idx, int alloc_flags); - +enum memmap_context { + MEMMAP_EARLY, + MEMMAP_HOTPLUG, +}; extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, - unsigned long size); + unsigned long size, + enum memmap_context context); #ifdef CONFIG_HAVE_MEMORY_PRESENT void memory_present(int nid, unsigned long start, unsigned long end); -- cgit v1.2.3