On Thu 2025-10-16 11:47:55, 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.
> 
> --- a/include/linux/console.h
> +++ b/include/linux/console.h
> @@ -606,6 +606,9 @@ extern bool nbcon_can_proceed(struct nbcon_write_context 
> *wctxt);
>  extern bool nbcon_enter_unsafe(struct nbcon_write_context *wctxt);
>  extern bool nbcon_exit_unsafe(struct nbcon_write_context *wctxt);
>  extern void nbcon_reacquire_nobuf(struct nbcon_write_context *wctxt);
> +extern bool nbcon_kdb_try_acquire(struct console *con,
> +                               struct nbcon_write_context *wctxt);
> +extern void nbcon_kdb_release(struct nbcon_write_context *wctxt);
>  
>  /*
>   * Check if the given console is currently capable and allowed to print
> @@ -655,6 +658,9 @@ static inline bool nbcon_can_proceed(struct 
> nbcon_write_context *wctxt) { return
>  static inline bool nbcon_enter_unsafe(struct nbcon_write_context *wctxt) { 
> return false; }
>  static inline bool nbcon_exit_unsafe(struct nbcon_write_context *wctxt) { 
> return false; }
>  static inline void nbcon_reacquire_nobuf(struct nbcon_write_context *wctxt) 
> { }
> +static inline bool nbcon_kdb_try_acquire(struct console *con,
> +                                      struct nbcon_write_context *wctxt) { 
> return false; }
> +static inline void nbcon_kdb_release(struct console *con) { }

A test robot found that this definition is using a wrong type,
see https://lore.kernel.org/all/[email protected]/

It should be:

static inline void nbcon_kdb_release(struct nbcon_write_context *wctxt) { }

No need for v7. I am going to fix this when committing the patchset.

Best Regards,
Petr


_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to