]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
printk: Avoid irq_work for printk_deferred() on suspend
authorJohn Ogness <john.ogness@linutronix.de>
Fri, 21 Nov 2025 10:20:00 +0000 (11:26 +0106)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:09 +0000 (12:57 +0100)
commit8626a78ce7ddaa807324a8e0056817ac8d1b0267
treefc70b2842340fed3a538f00664492688c508c976
parentbe8ba672cc5ae52e8a10ac8eddb89d88f66b3cab
printk: Avoid irq_work for printk_deferred() on suspend

commit 66e7c1e0ee08cfb6db64f8f3f6e5a3cc930145c8 upstream.

With commit ("printk: Avoid scheduling irq_work on suspend") the
implementation of printk_get_console_flush_type() was modified to
avoid offloading when irq_work should be blocked during suspend.
Since printk uses the returned flush type to determine what
flushing methods are used, this was thought to be sufficient for
avoiding irq_work usage during the suspend phase.

However, vprintk_emit() implements a hack to support
printk_deferred(). In this hack, the returned flush type is
adjusted to make sure no legacy direct printing occurs when
printk_deferred() was used.

Because of this hack, the legacy offloading flushing method can
still be used, causing irq_work to be queued when it should not
be.

Adjust the vprintk_emit() hack to also consider
@console_irqwork_blocked so that legacy offloading will not be
chosen when irq_work should be blocked.

Link: https://lore.kernel.org/lkml/87fra90xv4.fsf@jogness.linutronix.de
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Fixes: 26873e3e7f0c ("printk: Avoid scheduling irq_work on suspend")
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/printk/printk.c