The initialization for the SPU page structures broken with the inclusion of extreme sparsemem in current kernels. This works around that problem by further moving code around. Unfortunately, this patch is not only ugly, but also broken when CONFIG_NUMA is enabled, so this is not meant for inclusion in the near future. I hope someone finds a way to get a working solution for this. Signed-off-by: Arnd Bergmann Index: linux-2.6.16-rc/include/asm-powerpc/spu.h =================================================================== --- linux-2.6.16-rc.orig/include/asm-powerpc/spu.h +++ linux-2.6.16-rc/include/asm-powerpc/spu.h @@ -180,6 +180,13 @@ static inline void unregister_spu_syscal } #endif /* MODULE */ +#if defined(CONFIG_SPARSEMEM) && defined(CONFIG_PPC_CELL) +void __init cell_spumem_init(int early); +#else +static inline void cell_spumem_init(int early) +{ +} +#endif /* access to priv1 registers */ void spu_int_mask_and(struct spu *spu, int class, u64 mask); Index: linux-2.6.16-rc/arch/powerpc/platforms/cell/setup.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/platforms/cell/setup.c +++ linux-2.6.16-rc/arch/powerpc/platforms/cell/setup.c @@ -46,6 +46,7 @@ #include #include #include +#include #include "interrupt.h" #include "iommu.h" @@ -123,7 +124,7 @@ static void __init cell_spuprop_present( } } -static void __init cell_spumem_init(int early) +void __init cell_spumem_init(int early) { struct device_node *node; for (node = of_find_node_by_type(NULL, "spe"); @@ -134,10 +135,6 @@ static void __init cell_spumem_init(int cell_spuprop_present(node, "priv2", early); } } -#else -static void __init cell_spumem_init(int early) -{ -} #endif static void cell_progress(char *s, unsigned short hex) @@ -189,8 +186,6 @@ static void __init cell_init_early(void) ppc64_interrupt_controller = IC_CELL_PIC; - cell_spumem_init(1); - DBG(" <- cell_init_early()\n"); } Index: linux-2.6.16-rc/arch/powerpc/kernel/setup_64.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/setup_64.c +++ linux-2.6.16-rc/arch/powerpc/kernel/setup_64.c @@ -62,6 +62,7 @@ #include #include #include +#include #include "setup.h" @@ -609,6 +610,7 @@ void __init setup_arch(char **cmdline_p) /* set up the bootmem stuff with available memory */ do_init_bootmem(); + cell_spumem_init(1); sparse_init(); #ifdef CONFIG_DUMMY_CONSOLE --