aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorStas Sergeev <stsp@aknet.ru>2006-03-23 05:59:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 10:38:05 -0500
commit44fd22992cb76dc51c52cf4b8aff1bc7899bb23c (patch)
treeef10367137a340a554ebb3989598ef8af44d420b /init/main.c
parentffa930ef55ae82c09e30b2a0c4ce5d7fdea041e2 (diff)
[PATCH] Register the boot-cpu in the cpu maps earlier
Register the boot-cpu in the cpu maps earlier to allow the early printk to work, and to fix an obscure deadlock at boot. Signed-off-by: Stas Sergeev <stsp@aknet.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/init/main.c b/init/main.c
index 4c194c47395f..141e8896d252 100644
--- a/init/main.c
+++ b/init/main.c
@@ -438,6 +438,15 @@ void __init parse_early_param(void)
438 * Activate the first processor. 438 * Activate the first processor.
439 */ 439 */
440 440
441static void __init boot_cpu_init(void)
442{
443 int cpu = smp_processor_id();
444 /* Mark the boot cpu "present", "online" etc for SMP and UP case */
445 cpu_set(cpu, cpu_online_map);
446 cpu_set(cpu, cpu_present_map);
447 cpu_set(cpu, cpu_possible_map);
448}
449
441asmlinkage void __init start_kernel(void) 450asmlinkage void __init start_kernel(void)
442{ 451{
443 char * command_line; 452 char * command_line;
@@ -447,17 +456,13 @@ asmlinkage void __init start_kernel(void)
447 * enable them 456 * enable them
448 */ 457 */
449 lock_kernel(); 458 lock_kernel();
459 boot_cpu_init();
450 page_address_init(); 460 page_address_init();
451 printk(KERN_NOTICE); 461 printk(KERN_NOTICE);
452 printk(linux_banner); 462 printk(linux_banner);
453 setup_arch(&command_line); 463 setup_arch(&command_line);
454 setup_per_cpu_areas(); 464 setup_per_cpu_areas();
455 465 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
456 /*
457 * Mark the boot cpu "online" so that it can call console drivers in
458 * printk() and can access its per-cpu storage.
459 */
460 smp_prepare_boot_cpu();
461 466
462 /* 467 /*
463 * Set up the scheduler prior starting any interrupts (such as the 468 * Set up the scheduler prior starting any interrupts (such as the