summaryrefslogtreecommitdiff
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2011-06-21 13:57:54 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2011-06-21 13:57:54 +1000
commitc669c1cfdb51f5108b2da90a5d0f5c3dd2099242 (patch)
tree344680942a6eef7586c7828285a82aea33f62f9d /kernel/printk.c
parenta6873c7d11f681a21826a370341e36ac9f1f0af3 (diff)
parent0b251ee3e2dc6e09ac357fa65f3e0963a1176e1a (diff)
Merge remote-tracking branch 'tip/auto-latest'
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 35185392173f..751e7b84e9e3 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -782,7 +782,7 @@ static inline int can_use_console(unsigned int cpu)
static int console_trylock_for_printk(unsigned int cpu)
__releases(&logbuf_lock)
{
- int retval = 0;
+ int retval = 0, wake = 0;
if (console_trylock()) {
retval = 1;
@@ -795,12 +795,14 @@ static int console_trylock_for_printk(unsigned int cpu)
*/
if (!can_use_console(cpu)) {
console_locked = 0;
- up(&console_sem);
+ wake = 1;
retval = 0;
}
}
printk_cpu = UINT_MAX;
spin_unlock(&logbuf_lock);
+ if (wake)
+ up(&console_sem);
return retval;
}
static const char recursion_bug_msg [] =
@@ -1271,8 +1273,8 @@ void console_unlock(void)
if (unlikely(exclusive_console))
exclusive_console = NULL;
- up(&console_sem);
spin_unlock_irqrestore(&logbuf_lock, flags);
+ up(&console_sem);
if (wake_klogd)
wake_up_klogd();
}