summaryrefslogtreecommitdiff
path: root/kernel/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 6226e86fca32..d095aac9fb57 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -553,7 +553,14 @@ void console_unblank(void)
{
struct console *c;
- acquire_console_sem();
+ /*
+ * Try to get the console semaphore. If someone else owns it
+ * we have to return without unblanking because console_unblank
+ * may be called in interrupt context.
+ */
+ if (down_trylock(&console_sem) != 0)
+ return;
+ console_may_schedule = 0;
for (c = console_drivers; c != NULL; c = c->next)
if ((c->flags & CON_ENABLED) && c->unblank)
c->unblank();