summaryrefslogtreecommitdiff
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r--kernel/printk/printk.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index c1873d325ebd..362f177d2c84 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2132,9 +2132,9 @@ void resume_console(void)
* @hcpu: unused
*
* If printk() is called from a CPU that is not online yet, the messages
- * will be spooled but will not show up on the console. This function is
- * called when a new CPU comes online (or fails to come up), and ensures
- * that any such output gets printed.
+ * will be printed on the console only if there are CON_ANYTIME consoles.
+ * This function is called when a new CPU comes online (or fails to come
+ * up) or goes offline.
*/
static int console_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
@@ -2144,8 +2144,9 @@ static int console_cpu_notify(struct notifier_block *self,
case CPU_DEAD:
case CPU_DOWN_FAILED:
case CPU_UP_CANCELED:
- console_lock();
- console_unlock();
+ /* If trylock fails, someone else is doing the printing */
+ if (console_trylock())
+ console_unlock();
}
return NOTIFY_OK;
}