Re: [PATCH v4 2/5] printk: nbcon: Introduce KDB helpers

From: Petr Mladek
Date: Wed Sep 17 2025 - 07:18:00 EST


On Mon 2025-09-15 08:20:31, Marcos Paulo de Souza wrote:
> These helpers will be used when calling console->write_atomic on
> KDB code in the next patch. It's basically the same implementation
> as nbcon_device_try_acquire, but using NBCON_PRIO_EMERGENCY when
> acquiring the context.
>
> If the acquire succeeds, the message and message length are assigned to
> nbcon_write_context so ->write_atomic can print the message.
>
> After release try to flush the console since there may be a backlog of
> messages in the ringbuffer. The kthread console printers do not get a
> chance to run while kdb is active.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

Best Regards,
Petr