Skip to content

Commit 72c96a2

Browse files
marcospspmladek
authored andcommitted
printk: Check CON_SUSPEND when unblanking a console
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>
1 parent 5395e09 commit 72c96a2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

kernel/printk/printk.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3342,7 +3342,12 @@ void console_unblank(void)
33423342
*/
33433343
cookie = console_srcu_read_lock();
33443344
for_each_console_srcu(c) {
3345-
if ((console_srcu_read_flags(c) & CON_ENABLED) && c->unblank) {
3345+
short flags = console_srcu_read_flags(c);
3346+
3347+
if (flags & CON_SUSPENDED)
3348+
continue;
3349+
3350+
if ((flags & CON_ENABLED) && c->unblank) {
33463351
found_unblank = true;
33473352
break;
33483353
}
@@ -3379,7 +3384,12 @@ void console_unblank(void)
33793384

33803385
cookie = console_srcu_read_lock();
33813386
for_each_console_srcu(c) {
3382-
if ((console_srcu_read_flags(c) & CON_ENABLED) && c->unblank)
3387+
short flags = console_srcu_read_flags(c);
3388+
3389+
if (flags & CON_SUSPENDED)
3390+
continue;
3391+
3392+
if ((flags & CON_ENABLED) && c->unblank)
33833393
c->unblank();
33843394
}
33853395
console_srcu_read_unlock(cookie);

0 commit comments

Comments
 (0)