mirror of
https://gitee.com/openharmony/kernel_linux
synced 2025-04-15 13:50:42 +00:00
[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>
This commit is contained in:
parent
ffa930ef55
commit
44fd22992c
17
init/main.c
17
init/main.c
@ -438,6 +438,15 @@ void __init parse_early_param(void)
|
|||||||
* Activate the first processor.
|
* Activate the first processor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static void __init boot_cpu_init(void)
|
||||||
|
{
|
||||||
|
int cpu = smp_processor_id();
|
||||||
|
/* Mark the boot cpu "present", "online" etc for SMP and UP case */
|
||||||
|
cpu_set(cpu, cpu_online_map);
|
||||||
|
cpu_set(cpu, cpu_present_map);
|
||||||
|
cpu_set(cpu, cpu_possible_map);
|
||||||
|
}
|
||||||
|
|
||||||
asmlinkage void __init start_kernel(void)
|
asmlinkage void __init start_kernel(void)
|
||||||
{
|
{
|
||||||
char * command_line;
|
char * command_line;
|
||||||
@ -447,17 +456,13 @@ asmlinkage void __init start_kernel(void)
|
|||||||
* enable them
|
* enable them
|
||||||
*/
|
*/
|
||||||
lock_kernel();
|
lock_kernel();
|
||||||
|
boot_cpu_init();
|
||||||
page_address_init();
|
page_address_init();
|
||||||
printk(KERN_NOTICE);
|
printk(KERN_NOTICE);
|
||||||
printk(linux_banner);
|
printk(linux_banner);
|
||||||
setup_arch(&command_line);
|
setup_arch(&command_line);
|
||||||
setup_per_cpu_areas();
|
setup_per_cpu_areas();
|
||||||
|
smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
|
||||||
/*
|
|
||||||
* Mark the boot cpu "online" so that it can call console drivers in
|
|
||||||
* printk() and can access its per-cpu storage.
|
|
||||||
*/
|
|
||||||
smp_prepare_boot_cpu();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up the scheduler prior starting any interrupts (such as the
|
* Set up the scheduler prior starting any interrupts (such as the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user