Skip to content

Commit 66e7c1e

Browse files
jognesspmladek
authored andcommitted
printk: Avoid irq_work for printk_deferred() on suspend
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: 26873e3 ("printk: Avoid scheduling irq_work on suspend") Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.com>
1 parent 26873e3 commit 66e7c1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/printk/printk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2393,7 +2393,7 @@ asmlinkage int vprintk_emit(int facility, int level,
23932393
/* If called from the scheduler, we can not call up(). */
23942394
if (level == LOGLEVEL_SCHED) {
23952395
level = LOGLEVEL_DEFAULT;
2396-
ft.legacy_offload |= ft.legacy_direct;
2396+
ft.legacy_offload |= ft.legacy_direct && !console_irqwork_blocked;
23972397
ft.legacy_direct = false;
23982398
}
23992399

0 commit comments

Comments
 (0)