diff options
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 01b58d7d17ff..5092397fac29 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -588,8 +588,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
588 | log_level_unknown = 1; | 588 | log_level_unknown = 1; |
589 | } | 589 | } |
590 | 590 | ||
591 | if (!cpu_online(smp_processor_id()) && | 591 | if (!cpu_online(smp_processor_id())) { |
592 | system_state != SYSTEM_RUNNING) { | ||
593 | /* | 592 | /* |
594 | * Some console drivers may assume that per-cpu resources have | 593 | * Some console drivers may assume that per-cpu resources have |
595 | * been allocated. So don't allow them to be called by this | 594 | * been allocated. So don't allow them to be called by this |
@@ -876,8 +875,10 @@ void register_console(struct console * console) | |||
876 | break; | 875 | break; |
877 | console->flags |= CON_ENABLED; | 876 | console->flags |= CON_ENABLED; |
878 | console->index = console_cmdline[i].index; | 877 | console->index = console_cmdline[i].index; |
879 | if (i == preferred_console) | 878 | if (i == selected_console) { |
880 | console->flags |= CON_CONSDEV; | 879 | console->flags |= CON_CONSDEV; |
880 | preferred_console = selected_console; | ||
881 | } | ||
881 | break; | 882 | break; |
882 | } | 883 | } |
883 | 884 | ||
@@ -897,6 +898,8 @@ void register_console(struct console * console) | |||
897 | if ((console->flags & CON_CONSDEV) || console_drivers == NULL) { | 898 | if ((console->flags & CON_CONSDEV) || console_drivers == NULL) { |
898 | console->next = console_drivers; | 899 | console->next = console_drivers; |
899 | console_drivers = console; | 900 | console_drivers = console; |
901 | if (console->next) | ||
902 | console->next->flags &= ~CON_CONSDEV; | ||
900 | } else { | 903 | } else { |
901 | console->next = console_drivers->next; | 904 | console->next = console_drivers->next; |
902 | console_drivers->next = console; | 905 | console_drivers->next = console; |
@@ -937,10 +940,14 @@ int unregister_console(struct console * console) | |||
937 | /* If last console is removed, we re-enable picking the first | 940 | /* If last console is removed, we re-enable picking the first |
938 | * one that gets registered. Without that, pmac early boot console | 941 | * one that gets registered. Without that, pmac early boot console |
939 | * would prevent fbcon from taking over. | 942 | * would prevent fbcon from taking over. |
943 | * | ||
944 | * If this isn't the last console and it has CON_CONSDEV set, we | ||
945 | * need to set it on the next preferred console. | ||
940 | */ | 946 | */ |
941 | if (console_drivers == NULL) | 947 | if (console_drivers == NULL) |
942 | preferred_console = selected_console; | 948 | preferred_console = selected_console; |
943 | 949 | else if (console->flags & CON_CONSDEV) | |
950 | console_drivers->flags |= CON_CONSDEV; | ||
944 | 951 | ||
945 | release_console_sem(); | 952 | release_console_sem(); |
946 | return res; | 953 | return res; |