From: Marcos Paulo de Souza Date: Wed, 26 Feb 2025 19:59:05 +0000 (-0300) Subject: printk: Check CON_SUSPEND when unblanking a console X-Git-Tag: v6.15-rc1~136^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72c96a2dacc0fb056d13a5f02b0845c4c910fe54;p=thirdparty%2Fkernel%2Flinux.git printk: Check CON_SUSPEND when unblanking a console The commit 9e70a5e109a4 ("printk: Add per-console suspended state") introduced the CON_SUSPENDED flag for consoles. The suspended consoles will stop receiving messages, so don't unblank suspended consoles because it won't be showing anything either way. Signed-off-by: Marcos Paulo de Souza Reviewed-by: Petr Mladek Reviewed-by: John Ogness Link: https://lore.kernel.org/r/20250226-printk-renaming-v1-5-0b878577f2e6@suse.com Signed-off-by: Petr Mladek --- diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index c9843946559c2..0e6db80d55132 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -3342,7 +3342,12 @@ void console_unblank(void) */ cookie = console_srcu_read_lock(); for_each_console_srcu(c) { - if ((console_srcu_read_flags(c) & CON_ENABLED) && c->unblank) { + short flags = console_srcu_read_flags(c); + + if (flags & CON_SUSPENDED) + continue; + + if ((flags & CON_ENABLED) && c->unblank) { found_unblank = true; break; } @@ -3379,7 +3384,12 @@ void console_unblank(void) cookie = console_srcu_read_lock(); for_each_console_srcu(c) { - if ((console_srcu_read_flags(c) & CON_ENABLED) && c->unblank) + short flags = console_srcu_read_flags(c); + + if (flags & CON_SUSPENDED) + continue; + + if ((flags & CON_ENABLED) && c->unblank) c->unblank(); } console_srcu_read_unlock(cookie);