From c63c4faa8cf055319c7ed557d2050c1c3776fac5 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 7 Jun 2007 22:42:19 +1000 Subject: [POWERPC] Fix per-cpu allocation on oldworld SMP powermacs The per-cpu area(a) for the secondary CPU(s) isn't getting allocated on old SMP powermacs that don't have the secondary CPU(s) listed in the device tree, as per-cpu areas are now only allocated for CPUs in the cpu_possible_map, and we aren't setting the bits for the secondary CPU(s) until smp_prepare_cpus(), which is after per-cpu allocation. Therefore this sets the bits for CPUs 1..3 in cpu_possible_map in pmac_setup_arch, so they get per-cpu data allocated. Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/powermac/setup.c | 13 ++++++++++++- arch/powerpc/platforms/powermac/smp.c | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 07b1c4ec428..956571526a5 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c @@ -363,8 +363,19 @@ static void __init pmac_setup_arch(void) smp_ops = &core99_smp_ops; } #ifdef CONFIG_PPC32 - else + else { + /* + * We have to set bits in cpu_possible_map here since the + * secondary CPU(s) aren't in the device tree, and + * setup_per_cpu_areas only allocates per-cpu data for + * CPUs in the cpu_possible_map. + */ + int cpu; + + for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu) + cpu_set(cpu, cpu_possible_map); smp_ops = &psurge_smp_ops; + } #endif #endif /* CONFIG_SMP */ diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 686ed82bde7..cb2d894541c 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c @@ -317,7 +317,6 @@ static int __init smp_psurge_probe(void) ncpus = NR_CPUS; for (i = 1; i < ncpus ; ++i) { cpu_set(i, cpu_present_map); - cpu_set(i, cpu_possible_map); set_hard_smp_processor_id(i, i); } -- cgit v1.2.3 From 220ddc0847ebd42d18ee78c7e1c2f4c2e3be637d Mon Sep 17 00:00:00 2001 From: Milton Miller Date: Sun, 10 Jun 2007 14:32:43 +1000 Subject: [POWERPC] Fix console output getting dropped on platforms without udbg_putc Previously, registering this early console would just result in dropping early buffered printk output until a udbg_putc was registered. However, commit 69331af79cf29e26d1231152a172a1a10c2df511 clears the CON_PRINTBUFFER flag on the main console when a CON_BOOT (early) console has been registered, resulting in the buffered messages never being displayed to the user. This fixes the problem by making sure we don't register udbg_console on platforms that don't implement udbg_putc. Signed-off-by: Milton Miller Acked-by: Mark A. Greer Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/udbg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c index 87703df8750..cbca1df8bc6 100644 --- a/arch/powerpc/kernel/udbg.c +++ b/arch/powerpc/kernel/udbg.c @@ -151,12 +151,18 @@ static struct console udbg_console = { static int early_console_initialized; -/* called by setup_system */ +/* + * Called by setup_system after ppc_md->probe and ppc_md->early_init. + * Call it again after setting udbg_putc in ppc_md->setup_arch. + */ void register_early_udbg_console(void) { if (early_console_initialized) return; + if (!udbg_putc) + return; + if (strstr(boot_command_line, "udbg-immortal")) { printk(KERN_INFO "early console immortal !\n"); udbg_console.flags &= ~CON_BOOT; -- cgit v1.2.3