summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/printk-hack-out-emergency-loglevel-usage.patch
blob: f4e9eda8a55d2e8e24e1746b1e2af00f2ab742e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 3 Dec 2019 09:14:57 +0100
Subject: [PATCH] printk: hack out emergency loglevel usage
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz

Instead of using an emergency loglevel to determine if atomic
messages should be printed, use oops_in_progress. This conforms
to the decision that latency-causing atomic messages never be
generated during normal operation.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/printk/printk.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1777,15 +1777,8 @@ static void call_console_drivers(u64 seq
 			con->wrote_history = 1;
 			con->printk_seq = seq - 1;
 		}
-		if (con->write_atomic && level < emergency_console_loglevel &&
-		    facility == 0) {
-			/* skip emergency messages, already printed */
-			if (con->printk_seq < seq)
-				con->printk_seq = seq;
-			continue;
-		}
 		if (con->flags & CON_BOOT && facility == 0) {
-			/* skip emergency messages, already printed */
+			/* skip boot messages, already printed */
 			if (con->printk_seq < seq)
 				con->printk_seq = seq;
 			continue;
@@ -3171,7 +3164,7 @@ static bool console_can_emergency(int le
 	for_each_console(con) {
 		if (!(con->flags & CON_ENABLED))
 			continue;
-		if (con->write_atomic && level < emergency_console_loglevel)
+		if (con->write_atomic && oops_in_progress)
 			return true;
 		if (con->write && (con->flags & CON_BOOT))
 			return true;
@@ -3187,7 +3180,7 @@ static void call_emergency_console_drive
 	for_each_console(con) {
 		if (!(con->flags & CON_ENABLED))
 			continue;
-		if (con->write_atomic && level < emergency_console_loglevel) {
+		if (con->write_atomic && oops_in_progress) {
 			con->write_atomic(con, text, text_len);
 			continue;
 		}