Skip to content

Commit

Permalink
printk: Check CON_SUSPEND when unblanking a console
Browse files Browse the repository at this point in the history
The commit 9e70a5e ("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 <mpdesouza@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Link: https://lore.kernel.org/r/20250226-printk-renaming-v1-5-0b878577f2e6@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
  • Loading branch information
Marcos Paulo de Souza authored and Petr Mladek committed Mar 11, 2025
1 parent 5395e09 commit 72c96a2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 72c96a2

Please sign in to comment.