]> git.baikalelectronics.ru Git - kernel.git/commit
printk: wake waiters for safe and NMI contexts
authorJohn Ogness <john.ogness@linutronix.de>
Thu, 21 Apr 2022 21:22:40 +0000 (23:28 +0206)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:49 +0000 (10:22 +0200)
commitd42c7b172b18ddb69ca84c40cbe9aab62be34d04
treebe2a47f1dccdbd9506bbdbbc5ba671e56bdea225
parent515732c1cc71b4b1944e7b733073de6685bcfdda
printk: wake waiters for safe and NMI contexts

[ Upstream commit 0766f7355f88c0c4e841ab78feda0f12fffd89e2 ]

When printk() is called from safe or NMI contexts, it will directly
store the record (vprintk_store()) and then defer the console output.
However, defer_console_output() only causes console printing and does
not wake any waiters of new records.

Wake waiters from defer_console_output() so that they also are aware
of the new records from safe and NMI contexts.

Fixes: 78704e75083a ("printk/nmi: Prevent deadlock when accessing the main log buffer in NMI")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20220421212250.565456-6-john.ogness@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/printk/printk.c