Re: [PATCH printk v4 01/17] printk: nbcon: Add function for printers to reacquire ownership

From: Petr Mladek
Date: Tue Aug 27 2024 - 07:57:58 EST


On Tue 2024-08-27 06:49:17, John Ogness wrote:
> Since ownership can be lost at any time due to handover or
> takeover, a printing context _must_ be prepared to back out
> immediately and carefully. However, there are scenarios where
> the printing context must reacquire ownership in order to
> finalize or revert hardware changes.
>
> One such example is when interrupts are disabled during
> printing. No other context will automagically re-enable the
> interrupts. For this case, the disabling context _must_
> reacquire nbcon ownership so that it can re-enable the
> interrupts.
>
> Provide nbcon_reacquire_nobuf() for exactly this purpose. It
> allows a printing context to reacquire ownership using the same
> priority as its previous ownership.
>
> Note that after a successful reacquire the printing context
> will have no output buffer because that has been lost. This
> function cannot be used to resume printing.
>
> Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

Best Regards,
Petr