Re: netconsole: HARDIRQ-safe -> HARDIRQ-unsafe lock order warning
From: Mike Galbraith
Date: Mon Sep 08 2025 - 11:18:37 EST
On Mon, 2025-09-08 at 15:36 +0206, John Ogness wrote:
>
> Just be aware that ->write_atomic() will be called from _any_ context
> (including scheduler and NMI) and a console implementing this callback
> must handle the message or the message is lost for that console.
What I did locally was to steal panic_in_progress() from printk.c and
use that as the barrier between immediate xmit and queue for kworker
should locking challenged parties notice IRQs are off despite selective
bending up of NETPOLL's definition of "poll".
Not perfect, but safety first seems prudent, and not bad given the
panic_on knobs available.
-Mike