printk: hack out emergency loglevel usage

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>
This commit is contained in:
John Ogness 2019-12-03 09:14:57 +01:00 committed by Alibek Omarov
parent 077e7b2470
commit e827134d55

View File

@ -1810,15 +1810,8 @@ static void call_console_drivers(u64 seq, const char *ext_text, size_t ext_len,
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;
@ -3214,7 +3207,7 @@ static bool console_can_emergency(int level)
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;
@ -3230,7 +3223,7 @@ static void call_emergency_console_drivers(int level, const char *text,
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;
}