diff options
-rw-r--r-- | include/linux/kernel.h | 1 | ||||
-rw-r--r-- | kernel/printk.c | 10 | ||||
-rw-r--r-- | lib/bust_spinlocks.c | 10 |
3 files changed, 10 insertions, 11 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 7e861303cbde..e91dce75bbcc 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -176,6 +176,7 @@ static inline void console_verbose(void) | |||
176 | } | 176 | } |
177 | 177 | ||
178 | extern void bust_spinlocks(int yes); | 178 | extern void bust_spinlocks(int yes); |
179 | extern void wake_up_klogd(void); | ||
179 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 180 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
180 | extern int panic_timeout; | 181 | extern int panic_timeout; |
181 | extern int panic_on_oops; | 182 | extern int panic_on_oops; |
diff --git a/kernel/printk.c b/kernel/printk.c index 3e79e18dce33..4da26b067976 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -783,6 +783,12 @@ int is_console_locked(void) | |||
783 | return console_locked; | 783 | return console_locked; |
784 | } | 784 | } |
785 | 785 | ||
786 | void wake_up_klogd(void) | ||
787 | { | ||
788 | if (!oops_in_progress && waitqueue_active(&log_wait)) | ||
789 | wake_up_interruptible(&log_wait); | ||
790 | } | ||
791 | |||
786 | /** | 792 | /** |
787 | * release_console_sem - unlock the console system | 793 | * release_console_sem - unlock the console system |
788 | * | 794 | * |
@@ -825,8 +831,8 @@ void release_console_sem(void) | |||
825 | console_locked = 0; | 831 | console_locked = 0; |
826 | up(&console_sem); | 832 | up(&console_sem); |
827 | spin_unlock_irqrestore(&logbuf_lock, flags); | 833 | spin_unlock_irqrestore(&logbuf_lock, flags); |
828 | if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) | 834 | if (wake_klogd) |
829 | wake_up_interruptible(&log_wait); | 835 | wake_up_klogd(); |
830 | } | 836 | } |
831 | EXPORT_SYMBOL(release_console_sem); | 837 | EXPORT_SYMBOL(release_console_sem); |
832 | 838 | ||
diff --git a/lib/bust_spinlocks.c b/lib/bust_spinlocks.c index 0ee968e8e023..accb35658169 100644 --- a/lib/bust_spinlocks.c +++ b/lib/bust_spinlocks.c | |||
@@ -19,19 +19,11 @@ void __attribute__((weak)) bust_spinlocks(int yes) | |||
19 | if (yes) { | 19 | if (yes) { |
20 | oops_in_progress = 1; | 20 | oops_in_progress = 1; |
21 | } else { | 21 | } else { |
22 | int loglevel_save = console_loglevel; | ||
23 | #ifdef CONFIG_VT | 22 | #ifdef CONFIG_VT |
24 | unblank_screen(); | 23 | unblank_screen(); |
25 | #endif | 24 | #endif |
26 | oops_in_progress = 0; | 25 | oops_in_progress = 0; |
27 | /* | 26 | wake_up_klogd(); |
28 | * OK, the message is on the console. Now we call printk() | ||
29 | * without oops_in_progress set so that printk() will give klogd | ||
30 | * and the blanked console a poke. Hold onto your hats... | ||
31 | */ | ||
32 | console_loglevel = 15; /* NMI oopser may have shut the console up */ | ||
33 | printk(" "); | ||
34 | console_loglevel = loglevel_save; | ||
35 | } | 27 | } |
36 | } | 28 | } |
37 | 29 | ||