diff options
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 1455a0d4eedd..13c0a1143f49 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -199,7 +199,7 @@ void __init setup_log_buf(int early) | |||
199 | unsigned long mem; | 199 | unsigned long mem; |
200 | 200 | ||
201 | mem = memblock_alloc(new_log_buf_len, PAGE_SIZE); | 201 | mem = memblock_alloc(new_log_buf_len, PAGE_SIZE); |
202 | if (mem == MEMBLOCK_ERROR) | 202 | if (!mem) |
203 | return; | 203 | return; |
204 | new_log_buf = __va(mem); | 204 | new_log_buf = __va(mem); |
205 | } else { | 205 | } else { |
@@ -521,7 +521,7 @@ static void __call_console_drivers(unsigned start, unsigned end) | |||
521 | } | 521 | } |
522 | } | 522 | } |
523 | 523 | ||
524 | static int __read_mostly ignore_loglevel; | 524 | static bool __read_mostly ignore_loglevel; |
525 | 525 | ||
526 | static int __init ignore_loglevel_setup(char *str) | 526 | static int __init ignore_loglevel_setup(char *str) |
527 | { | 527 | { |
@@ -532,7 +532,7 @@ static int __init ignore_loglevel_setup(char *str) | |||
532 | } | 532 | } |
533 | 533 | ||
534 | early_param("ignore_loglevel", ignore_loglevel_setup); | 534 | early_param("ignore_loglevel", ignore_loglevel_setup); |
535 | module_param_named(ignore_loglevel, ignore_loglevel, bool, S_IRUGO | S_IWUSR); | 535 | module_param(ignore_loglevel, bool, S_IRUGO | S_IWUSR); |
536 | MODULE_PARM_DESC(ignore_loglevel, "ignore loglevel setting, to" | 536 | MODULE_PARM_DESC(ignore_loglevel, "ignore loglevel setting, to" |
537 | "print all kernel messages to the console."); | 537 | "print all kernel messages to the console."); |
538 | 538 | ||
@@ -688,6 +688,7 @@ static void zap_locks(void) | |||
688 | 688 | ||
689 | oops_timestamp = jiffies; | 689 | oops_timestamp = jiffies; |
690 | 690 | ||
691 | debug_locks_off(); | ||
691 | /* If a crash is occurring, make sure we can't deadlock */ | 692 | /* If a crash is occurring, make sure we can't deadlock */ |
692 | raw_spin_lock_init(&logbuf_lock); | 693 | raw_spin_lock_init(&logbuf_lock); |
693 | /* And make sure that we print immediately */ | 694 | /* And make sure that we print immediately */ |
@@ -695,9 +696,9 @@ static void zap_locks(void) | |||
695 | } | 696 | } |
696 | 697 | ||
697 | #if defined(CONFIG_PRINTK_TIME) | 698 | #if defined(CONFIG_PRINTK_TIME) |
698 | static int printk_time = 1; | 699 | static bool printk_time = 1; |
699 | #else | 700 | #else |
700 | static int printk_time = 0; | 701 | static bool printk_time = 0; |
701 | #endif | 702 | #endif |
702 | module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); | 703 | module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); |
703 | 704 | ||
@@ -840,9 +841,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
840 | boot_delay_msec(); | 841 | boot_delay_msec(); |
841 | printk_delay(); | 842 | printk_delay(); |
842 | 843 | ||
843 | preempt_disable(); | ||
844 | /* This stops the holder of console_sem just where we want him */ | 844 | /* This stops the holder of console_sem just where we want him */ |
845 | raw_local_irq_save(flags); | 845 | local_irq_save(flags); |
846 | this_cpu = smp_processor_id(); | 846 | this_cpu = smp_processor_id(); |
847 | 847 | ||
848 | /* | 848 | /* |
@@ -856,7 +856,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
856 | * recursion and return - but flag the recursion so that | 856 | * recursion and return - but flag the recursion so that |
857 | * it can be printed at the next appropriate moment: | 857 | * it can be printed at the next appropriate moment: |
858 | */ | 858 | */ |
859 | if (!oops_in_progress) { | 859 | if (!oops_in_progress && !lockdep_recursing(current)) { |
860 | recursion_bug = 1; | 860 | recursion_bug = 1; |
861 | goto out_restore_irqs; | 861 | goto out_restore_irqs; |
862 | } | 862 | } |
@@ -962,9 +962,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
962 | 962 | ||
963 | lockdep_on(); | 963 | lockdep_on(); |
964 | out_restore_irqs: | 964 | out_restore_irqs: |
965 | raw_local_irq_restore(flags); | 965 | local_irq_restore(flags); |
966 | 966 | ||
967 | preempt_enable(); | ||
968 | return printed_len; | 967 | return printed_len; |
969 | } | 968 | } |
970 | EXPORT_SYMBOL(printk); | 969 | EXPORT_SYMBOL(printk); |
@@ -1099,7 +1098,7 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha | |||
1099 | return -1; | 1098 | return -1; |
1100 | } | 1099 | } |
1101 | 1100 | ||
1102 | int console_suspend_enabled = 1; | 1101 | bool console_suspend_enabled = 1; |
1103 | EXPORT_SYMBOL(console_suspend_enabled); | 1102 | EXPORT_SYMBOL(console_suspend_enabled); |
1104 | 1103 | ||
1105 | static int __init console_suspend_disable(char *str) | 1104 | static int __init console_suspend_disable(char *str) |
@@ -1293,10 +1292,11 @@ again: | |||
1293 | raw_spin_lock(&logbuf_lock); | 1292 | raw_spin_lock(&logbuf_lock); |
1294 | if (con_start != log_end) | 1293 | if (con_start != log_end) |
1295 | retry = 1; | 1294 | retry = 1; |
1295 | raw_spin_unlock_irqrestore(&logbuf_lock, flags); | ||
1296 | |||
1296 | if (retry && console_trylock()) | 1297 | if (retry && console_trylock()) |
1297 | goto again; | 1298 | goto again; |
1298 | 1299 | ||
1299 | raw_spin_unlock_irqrestore(&logbuf_lock, flags); | ||
1300 | if (wake_klogd) | 1300 | if (wake_klogd) |
1301 | wake_up_klogd(); | 1301 | wake_up_klogd(); |
1302 | } | 1302 | } |