Re: [PATCH] nbcon/reboot: Flush nbcon consoles synchronously on reboot

From: John Ogness

Date: Mon Oct 12 2026 - 10:09:42 EST


On 2026-10-09, Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> wrote:
> 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?

We have the syscore.ops.shutdown registered notifier that gracefully
shuts down the kthread printers and transitions to atomic printing.

There is a pr_flush() in kernel_power_off(), but actually that is no
longer needed and should be removed.

John