summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2022-07-15 16:43:42 +0200
committerPetr Mladek <pmladek@suse.com>2022-07-15 16:43:42 +0200
commit1ac8ec2731a5ae0f283d103873be7b945ba97e90 (patch)
tree1ad87d41df81cb7e2268cd112c0e421e86e6b779 /kernel
parent51889d225ce2ce118d8413eb4282045add81a689 (diff)
parent9023ca0866250d268b047f21e1392e7a81277a54 (diff)
Merge branch 'rework/kthreads' into for-linus
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk/printk.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index b49c6ff6dca0..a1a81fd9889b 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3380,6 +3380,7 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre
diff = 0;
console_lock();
+
for_each_console(c) {
if (con && con != c)
continue;
@@ -3389,11 +3390,19 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre
if (printk_seq < seq)
diff += seq - printk_seq;
}
- console_unlock();
- if (diff != last_diff && reset_on_progress)
+ /*
+ * If consoles are suspended, it cannot be expected that they
+ * make forward progress, so timeout immediately. @diff is
+ * still used to return a valid flush status.
+ */
+ if (console_suspended)
+ remaining = 0;
+ else if (diff != last_diff && reset_on_progress)
remaining = timeout_ms;
+ console_unlock();
+
if (diff == 0 || remaining == 0)
break;