Re: [PATCH v2] nbcon/reboot: Switch NBCON consoles into the emergency mode in emergency_restart()

From: Petr Mladek

Date: Wed Oct 14 2026 - 06:02:51 EST


On Tue 2026-10-13 17:41:41, Petr Mladek wrote:
> When the system is going down a normal way, the NBCON kthreads are
> flushed and stopped properly via a syscore shutdown callback, see
> printk_kthreads_shutdown().
>
> One missing piece is emergency_restart() where the kthreads are not
> stopped. It might be called from several non-panic code paths,
> e.g. sysrq-o, kdb_reboot(), or some watchdogs.
>
> Fix it by explicitly entering the emergency (atomic) mode and trying
> to flush the consoles there.
>
> Note that printk_trigger_flush() must be used instead of pr_flush()
> because the later is not safe in an atomic context.
>
> 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>

JFYI, the patch has been committed into printk/linux.git,
branch for-7.3-hotfix.

I am going to give it a spin in linux-next and send a pull
request on Friday unless any blocker appears in the meantime.

Best Regards,
Petr