diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/init/main.c b/init/main.c index 63534a141b4e..ea73e1eb361c 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -9,6 +9,8 @@ | |||
9 | * Simplified starting of init: Michael A. Griffith <grif@acm.org> | 9 | * Simplified starting of init: Michael A. Griffith <grif@acm.org> |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define DEBUG /* Enable initcall_debug */ | ||
13 | |||
12 | #include <linux/types.h> | 14 | #include <linux/types.h> |
13 | #include <linux/module.h> | 15 | #include <linux/module.h> |
14 | #include <linux/proc_fs.h> | 16 | #include <linux/proc_fs.h> |
@@ -174,8 +176,8 @@ static int __init obsolete_checksetup(char *line) | |||
174 | if (line[n] == '\0' || line[n] == '=') | 176 | if (line[n] == '\0' || line[n] == '=') |
175 | had_early_param = 1; | 177 | had_early_param = 1; |
176 | } else if (!p->setup_func) { | 178 | } else if (!p->setup_func) { |
177 | printk(KERN_WARNING "Parameter %s is obsolete," | 179 | pr_warn("Parameter %s is obsolete, ignored\n", |
178 | " ignored\n", p->str); | 180 | p->str); |
179 | return 1; | 181 | return 1; |
180 | } else if (p->setup_func(line + n)) | 182 | } else if (p->setup_func(line + n)) |
181 | return 1; | 183 | return 1; |
@@ -398,8 +400,7 @@ static int __init do_early_param(char *param, char *val, const char *unused) | |||
398 | strcmp(p->str, "earlycon") == 0) | 400 | strcmp(p->str, "earlycon") == 0) |
399 | ) { | 401 | ) { |
400 | if (p->setup_func(val) != 0) | 402 | if (p->setup_func(val) != 0) |
401 | printk(KERN_WARNING | 403 | pr_warn("Malformed early option '%s'\n", param); |
402 | "Malformed early option '%s'\n", param); | ||
403 | } | 404 | } |
404 | } | 405 | } |
405 | /* We accept everything at this stage. */ | 406 | /* We accept everything at this stage. */ |
@@ -497,7 +498,7 @@ asmlinkage void __init start_kernel(void) | |||
497 | tick_init(); | 498 | tick_init(); |
498 | boot_cpu_init(); | 499 | boot_cpu_init(); |
499 | page_address_init(); | 500 | page_address_init(); |
500 | printk(KERN_NOTICE "%s", linux_banner); | 501 | pr_notice("%s", linux_banner); |
501 | setup_arch(&command_line); | 502 | setup_arch(&command_line); |
502 | mm_init_owner(&init_mm, &init_task); | 503 | mm_init_owner(&init_mm, &init_task); |
503 | mm_init_cpumask(&init_mm); | 504 | mm_init_cpumask(&init_mm); |
@@ -509,7 +510,7 @@ asmlinkage void __init start_kernel(void) | |||
509 | build_all_zonelists(NULL, NULL); | 510 | build_all_zonelists(NULL, NULL); |
510 | page_alloc_init(); | 511 | page_alloc_init(); |
511 | 512 | ||
512 | printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); | 513 | pr_notice("Kernel command line: %s\n", boot_command_line); |
513 | parse_early_param(); | 514 | parse_early_param(); |
514 | parse_args("Booting kernel", static_command_line, __start___param, | 515 | parse_args("Booting kernel", static_command_line, __start___param, |
515 | __stop___param - __start___param, | 516 | __stop___param - __start___param, |
@@ -539,11 +540,8 @@ asmlinkage void __init start_kernel(void) | |||
539 | * fragile until we cpu_idle() for the first time. | 540 | * fragile until we cpu_idle() for the first time. |
540 | */ | 541 | */ |
541 | preempt_disable(); | 542 | preempt_disable(); |
542 | if (!irqs_disabled()) { | 543 | if (WARN(!irqs_disabled(), "Interrupts were enabled *very* early, fixing it\n")) |
543 | printk(KERN_WARNING "start_kernel(): bug: interrupts were " | ||
544 | "enabled *very* early, fixing it\n"); | ||
545 | local_irq_disable(); | 544 | local_irq_disable(); |
546 | } | ||
547 | idr_init_cache(); | 545 | idr_init_cache(); |
548 | perf_event_init(); | 546 | perf_event_init(); |
549 | rcu_init(); | 547 | rcu_init(); |
@@ -558,9 +556,7 @@ asmlinkage void __init start_kernel(void) | |||
558 | time_init(); | 556 | time_init(); |
559 | profile_init(); | 557 | profile_init(); |
560 | call_function_init(); | 558 | call_function_init(); |
561 | if (!irqs_disabled()) | 559 | WARN(!irqs_disabled(), "Interrupts were enabled early\n"); |
562 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " | ||
563 | "enabled early\n"); | ||
564 | early_boot_irqs_disabled = false; | 560 | early_boot_irqs_disabled = false; |
565 | local_irq_enable(); | 561 | local_irq_enable(); |
566 | 562 | ||
@@ -587,8 +583,7 @@ asmlinkage void __init start_kernel(void) | |||
587 | #ifdef CONFIG_BLK_DEV_INITRD | 583 | #ifdef CONFIG_BLK_DEV_INITRD |
588 | if (initrd_start && !initrd_below_start_ok && | 584 | if (initrd_start && !initrd_below_start_ok && |
589 | page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) { | 585 | page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) { |
590 | printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - " | 586 | pr_crit("initrd overwritten (0x%08lx < 0x%08lx) - disabling it.\n", |
591 | "disabling it.\n", | ||
592 | page_to_pfn(virt_to_page((void *)initrd_start)), | 587 | page_to_pfn(virt_to_page((void *)initrd_start)), |
593 | min_low_pfn); | 588 | min_low_pfn); |
594 | initrd_start = 0; | 589 | initrd_start = 0; |
@@ -667,14 +662,14 @@ static int __init_or_module do_one_initcall_debug(initcall_t fn) | |||
667 | unsigned long long duration; | 662 | unsigned long long duration; |
668 | int ret; | 663 | int ret; |
669 | 664 | ||
670 | printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current)); | 665 | pr_debug("calling %pF @ %i\n", fn, task_pid_nr(current)); |
671 | calltime = ktime_get(); | 666 | calltime = ktime_get(); |
672 | ret = fn(); | 667 | ret = fn(); |
673 | rettime = ktime_get(); | 668 | rettime = ktime_get(); |
674 | delta = ktime_sub(rettime, calltime); | 669 | delta = ktime_sub(rettime, calltime); |
675 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; | 670 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; |
676 | printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n", fn, | 671 | pr_debug("initcall %pF returned %d after %lld usecs\n", |
677 | ret, duration); | 672 | fn, ret, duration); |
678 | 673 | ||
679 | return ret; | 674 | return ret; |
680 | } | 675 | } |
@@ -702,9 +697,7 @@ int __init_or_module do_one_initcall(initcall_t fn) | |||
702 | strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); | 697 | strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); |
703 | local_irq_enable(); | 698 | local_irq_enable(); |
704 | } | 699 | } |
705 | if (msgbuf[0]) { | 700 | WARN(msgbuf[0], "initcall %pF returned with %s\n", fn, msgbuf); |
706 | printk("initcall %pF returned with %s\n", fn, msgbuf); | ||
707 | } | ||
708 | 701 | ||
709 | return ret; | 702 | return ret; |
710 | } | 703 | } |
@@ -832,8 +825,7 @@ static int __ref kernel_init(void *unused) | |||
832 | if (ramdisk_execute_command) { | 825 | if (ramdisk_execute_command) { |
833 | if (!run_init_process(ramdisk_execute_command)) | 826 | if (!run_init_process(ramdisk_execute_command)) |
834 | return 0; | 827 | return 0; |
835 | printk(KERN_WARNING "Failed to execute %s\n", | 828 | pr_err("Failed to execute %s\n", ramdisk_execute_command); |
836 | ramdisk_execute_command); | ||
837 | } | 829 | } |
838 | 830 | ||
839 | /* | 831 | /* |
@@ -845,8 +837,8 @@ static int __ref kernel_init(void *unused) | |||
845 | if (execute_command) { | 837 | if (execute_command) { |
846 | if (!run_init_process(execute_command)) | 838 | if (!run_init_process(execute_command)) |
847 | return 0; | 839 | return 0; |
848 | printk(KERN_WARNING "Failed to execute %s. Attempting " | 840 | pr_err("Failed to execute %s. Attempting defaults...\n", |
849 | "defaults...\n", execute_command); | 841 | execute_command); |
850 | } | 842 | } |
851 | if (!run_init_process("/sbin/init") || | 843 | if (!run_init_process("/sbin/init") || |
852 | !run_init_process("/etc/init") || | 844 | !run_init_process("/etc/init") || |
@@ -891,7 +883,7 @@ static noinline void __init kernel_init_freeable(void) | |||
891 | 883 | ||
892 | /* Open the /dev/console on the rootfs, this should never fail */ | 884 | /* Open the /dev/console on the rootfs, this should never fail */ |
893 | if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) | 885 | if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) |
894 | printk(KERN_WARNING "Warning: unable to open an initial console.\n"); | 886 | pr_err("Warning: unable to open an initial console.\n"); |
895 | 887 | ||
896 | (void) sys_dup(0); | 888 | (void) sys_dup(0); |
897 | (void) sys_dup(0); | 889 | (void) sys_dup(0); |