All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.15-rt] printk: fix suppressed message print when reboot/panic
@ 2022-03-21 11:15 Schspa Shi
  2022-03-21 13:04 ` John Ogness
  0 siblings, 1 reply; 2+ messages in thread
From: Schspa Shi @ 2022-03-21 11:15 UTC (permalink / raw)
  To: pmladek, sergey.senozhatsky, rostedt, john.ogness
  Cc: linux-rt-users, linux-kernel, bigeasy, tglx, schspa

Update printk_seq for suppressed message.

When message is suppressed, printk_seq should be updated, otherwise
this message will be printed when reboot. This problem was introduced
in commit 3edc0c85d154 ("printk: Rebase on top of new ring buffer").

This patch apply fix to 5.15-rt according to
Message-ID: <87a6dj3b5c.fsf@jogness.linutronix.de>

Signed-off-by: Schspa Shi <schspa@gmail.com>
---
 kernel/printk/printk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 0cc8e8acf545..c3e245c95de4 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2255,8 +2255,12 @@ static int printk_kthread_func(void *data)
 		if (!(con->flags & CON_ENABLED))
 			continue;
 
-		if (suppress_message_printing(r.info->level))
+		if (suppress_message_printing(r.info->level)) {
+			console_lock();
+			latched_seq_write(&con->printk_seq, seq);
+			console_unlock();
 			continue;
+		}
 
 		if (con->flags & CON_EXTENDED) {
 			len = info_print_ext_header(ext_text,
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.15-rt] printk: fix suppressed message print when reboot/panic
  2022-03-21 11:15 [PATCH 5.15-rt] printk: fix suppressed message print when reboot/panic Schspa Shi
@ 2022-03-21 13:04 ` John Ogness
  0 siblings, 0 replies; 2+ messages in thread
From: John Ogness @ 2022-03-21 13:04 UTC (permalink / raw)
  To: Schspa Shi, pmladek, sergey.senozhatsky, rostedt
  Cc: linux-rt-users, linux-kernel, bigeasy, tglx, schspa

On 2022-03-21, Schspa Shi <schspa@gmail.com> wrote:
> Update printk_seq for suppressed message.
>
> When message is suppressed, printk_seq should be updated, otherwise
> this message will be printed when reboot. This problem was introduced
> in commit 3edc0c85d154 ("printk: Rebase on top of new ring buffer").
>
> This patch apply fix to 5.15-rt according to
> Message-ID: <87a6dj3b5c.fsf@jogness.linutronix.de>
>
> Signed-off-by: Schspa Shi <schspa@gmail.com>

Reviewed-by: John Ogness <john.ogness@linutronix.de>

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-21 13:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-21 11:15 [PATCH 5.15-rt] printk: fix suppressed message print when reboot/panic Schspa Shi
2022-03-21 13:04 ` John Ogness

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.