Re: [PATCH] nbcon/reboot: Flush nbcon consoles synchronously on reboot
From: Sebastian Andrzej Siewior
Date: Fri Oct 09 2026 - 02:53:01 EST
On 2026-10-08 17:08:52 [+0200], Petr Mladek wrote:
> NBCON consoles emit messages in a dedicated kthreads when the system
> is working properly. printk() tries to flush them synchronously in
> explicitly marked emergency context and in panic().
>
> Another situation where printk() could not rely on kthreads are the various
> reboot and halt code paths. They can be detected by the `system_state`
> variable.
>
> Let's default to NBCON_PRIO_EMERGENCY for the post-running states.
> printk() will automatically try flushing the consoles synchronously.
> Also do not rely on printk() and explicitly flush the consoles
> after these states are set.
while this seems okay, didn't we have pr_flush() to flush the output on
shutdown/ reboot?
> Note that suspend code paths have already been handled, see
> console_suspend_all() and console_suspend().
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/all/202608061008.48a1e76e-lkp@xxxxxxxxx/
> Suggested-by: John Ogness <john.ogness@xxxxxxxxxxxxx>
> Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
Sebastian