@@ -3530,7 +3530,7 @@ void console_suspend(struct console *console)
{
__pr_flush(console, 1000, true);
console_list_lock();
- console_srcu_write_flags(console, console->flags & ~CON_ENABLED);
+ console_srcu_write_flags(console, console->flags | CON_SUSPENDED);
console_list_unlock();
/*
@@ -3543,13 +3543,14 @@ void console_suspend(struct console *console)
}
EXPORT_SYMBOL(console_suspend);
+/* Unset CON_SUSPENDED flag so the console can start printing again. */
void console_resume(struct console *console)
{
struct console_flush_type ft;
bool is_nbcon;
console_list_lock();
- console_srcu_write_flags(console, console->flags | CON_ENABLED);
+ console_srcu_write_flags(console, console->flags & ~CON_SUSPENDED);
is_nbcon = console->flags & CON_NBCON;
console_list_unlock();
Since commit 9e70a5e109a4 ("printk: Add per-console suspended state") the CON_SUSPENDED flag was introced, and this flag was being checked on console_is_usable function, which returns false if the console is suspended. No functional changes. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> --- kernel/printk/printk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)