|
@@ -2028,15 +2028,16 @@ void resume_console(void)
|
|
|
* @cpu: 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(unsigned int cpu)
|
|
|
{
|
|
|
if (!cpuhp_tasks_frozen) {
|
|
|
- console_lock();
|
|
|
- console_unlock();
|
|
|
+ /* If trylock fails, someone else is doing the printing */
|
|
|
+ if (console_trylock())
|
|
|
+ console_unlock();
|
|
|
}
|
|
|
return 0;
|
|
|
}
|