Re: [patch 08/11] spufs: make mem files mmappable

From: Arnd Bergmann
Date: Sat Sep 17 2005 - 01:58:42 EST


On Freedag 16 September 2005 14:16, Arnd Bergmann wrote:
> This should get better as soon as extreme sparsemem gets merged.
>
Actually, it first got worse.

The initialization for the SPU page structures broke
with the inclusion of extreme sparsemem in current
kernels. This patch works around that problem by further
moving code around.

I still need to find a way to do this in a cleaner way,
but for now, it restores the basic functionality.

Signed-off-by: Arnd Bergmann <arndb@xxxxxxxxxx>

Index: linux-cg/include/asm-ppc64/spu.h
===================================================================
--- linux-cg.orig/include/asm-ppc64/spu.h
+++ linux-cg/include/asm-ppc64/spu.h
@@ -167,6 +167,13 @@ static inline void unregister_spu_syscal
}
#endif /* MODULE */

+#if defined(CONFIG_SPARSEMEM) && defined(CONFIG_PPC_BPA)
+void __init bpa_spumem_init(int early);
+#else
+static inline void bpa_spumem_init(int early)
+{
+}
+#endif

/*
* This defines the Local Store, Problem Area and Privlege Area of an SPU.
Index: linux-cg/arch/ppc64/kernel/bpa_setup.c
===================================================================
--- linux-cg.orig/arch/ppc64/kernel/bpa_setup.c
+++ linux-cg/arch/ppc64/kernel/bpa_setup.c
@@ -122,7 +122,7 @@ static void __init bpa_spuprop_present(s
}
}

-static void __init bpa_spumem_init(int early)
+void __init bpa_spumem_init(int early)
{
struct device_node *node;
for (node = of_find_node_by_type(NULL, "spe");
@@ -133,10 +133,6 @@ static void __init bpa_spumem_init(int e
bpa_spuprop_present(node, "priv2", early);
}
}
-#else
-static void __init bpa_spumem_init(int early)
-{
-}
#endif

static void bpa_progress(char *s, unsigned short hex)
@@ -187,8 +183,6 @@ static void __init bpa_init_early(void)

ppc64_interrupt_controller = IC_BPA_IIC;

- bpa_spumem_init(1);
-
DBG(" <- bpa_init_early()\n");
}

Index: linux-cg/arch/ppc64/kernel/setup.c
===================================================================
--- linux-cg.orig/arch/ppc64/kernel/setup.c
+++ linux-cg/arch/ppc64/kernel/setup.c
@@ -58,6 +58,7 @@
#include <asm/mmu.h>
#include <asm/lmb.h>
#include <asm/iSeries/ItLpNaca.h>
+#include <asm/spu.h>

#ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt)
@@ -1042,6 +1043,8 @@ void __init setup_arch(char **cmdline_p)

/* set up the bootmem stuff with available memory */
do_init_bootmem();
+ bpa_spumem_init(1);
+
sparse_init();

/* initialize the syscall map in systemcfg */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/