From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Sherry Sun <sherry.sun@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
Jon Hunter <jonathanh@nvidia.com>,
Thierry Reding <thierry.reding@gmail.com>,
Derek Barbosa <debarbos@redhat.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH printk v2 2/2] printk: Avoid scheduling irq_work on suspend
Date: Fri, 14 Nov 2025 15:55:24 +0100 [thread overview]
Message-ID: <aRdC3Dd-dfoWopS1@pathway.suse.cz> (raw)
In-Reply-To: <20251113160351.113031-3-john.ogness@linutronix.de>
On Thu 2025-11-13 17:09:48, John Ogness wrote:
> Allowing irq_work to be scheduled while trying to suspend has shown
> to cause problems as some architectures interpret the pending
> interrupts as a reason to not suspend. This became a problem for
> printk() with the introduction of NBCON consoles. With every
> printk() call, NBCON console printing kthreads are woken by queueing
> irq_work. This means that irq_work continues to be queued due to
> printk() calls late in the suspend procedure.
>
> Avoid this problem by preventing printk() from queueing irq_work
> once console suspending has begun. This applies to triggering NBCON
> and legacy deferred printing as well as klogd waiters.
>
> Since triggering of NBCON threaded printing relies on irq_work, the
> pr_flush() within console_suspend_all() is used to perform the final
> flushing before suspending consoles and blocking irq_work queueing.
> NBCON consoles that are not suspended (due to the usage of the
> "no_console_suspend" boot argument) transition to atomic flushing.
>
> Introduce a new global variable @console_irqwork_blocked to flag
> when irq_work queueing is to be avoided. The flag is used by
> printk_get_console_flush_type() to avoid allowing deferred printing
> and switch NBCON consoles to atomic flushing. It is also used by
> vprintk_emit() to avoid klogd waking.
>
> Add WARN_ON_ONCE(console_irqwork_blocked) to the irq_work queuing
> functions to catch any code that attempts to queue printk irq_work
> during the suspending/resuming procedure.
>
> Cc: <stable@vger.kernel.org> # 6.13.x because no drivers in 6.12.x
> Fixes: 6b93bb41f6ea ("printk: Add non-BKL (nbcon) console basic infrastructure")
> Closes: https://lore.kernel.org/lkml/DB9PR04MB8429E7DDF2D93C2695DE401D92C4A@DB9PR04MB8429.eurprd04.prod.outlook.com
> Signed-off-by: John Ogness <john.ogness@linutronix.de>
The changes look goot to me:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
next prev parent reply other threads:[~2025-11-14 14:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 16:03 [PATCH printk v2 0/2] Fix reported suspend failures John Ogness
2025-11-13 16:03 ` [PATCH printk v2 1/2] printk: Allow printk_trigger_flush() to flush all types John Ogness
2025-11-14 13:42 ` Petr Mladek
2025-11-13 16:03 ` [PATCH printk v2 2/2] printk: Avoid scheduling irq_work on suspend John Ogness
2025-11-13 16:38 ` Derek Barbosa
2025-11-13 17:06 ` John Ogness
2025-11-13 19:15 ` Derek Barbosa
2025-11-25 19:24 ` Derek Barbosa
2025-11-26 9:22 ` Petr Mladek
2025-11-14 14:55 ` Petr Mladek [this message]
2025-11-14 14:57 ` [PATCH printk v2 0/2] Fix reported suspend failures Petr Mladek
2025-11-16 12:14 ` Sherry Sun
2025-11-19 15:30 ` Petr Mladek
2025-11-20 11:03 ` John Ogness
2025-11-21 9:55 ` Petr Mladek
2025-11-20 13:33 ` Thierry Reding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aRdC3Dd-dfoWopS1@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=debarbos@redhat.com \
--cc=john.ogness@linutronix.de \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ping.bai@nxp.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=sherry.sun@nxp.com \
--cc=stable@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox