From: Marcos Paulo de Souza <mpdesouza@suse.com>
To: John Ogness <john.ogness@linutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jason Wessel <jason.wessel@windriver.com>,
Daniel Thompson <danielt@kernel.org>,
Douglas Anderson <dianders@chromium.org>
Cc: linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net
Subject: Re: [PATCH v3 3/4] printk: nbcon: Allow KDB to acquire the NBCON context
Date: Fri, 05 Sep 2025 15:30:48 -0300 [thread overview]
Message-ID: <85defbcb97090bcfa0995bbd58f8e41d8288ca44.camel@suse.com> (raw)
In-Reply-To: <84y0qtdk99.fsf@jogness.linutronix.de>
On Fri, 2025-09-05 at 16:58 +0206, John Ogness wrote:
> On 2025-09-02, Marcos Paulo de Souza <mpdesouza@suse.com> wrote:
> > diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
> > index
> > ff218e95a505fd10521c2c4dfb00ad5ec5773953..352235a0eb4a484caccf86d3a
> > 57d1a149218ecec 100644
> > --- a/kernel/printk/nbcon.c
> > +++ b/kernel/printk/nbcon.c
> > @@ -255,6 +258,7 @@ static int
> > nbcon_context_try_acquire_direct(struct nbcon_context *ctxt,
> > * interrupted by the panic CPU while printing.
> > */
> > if (other_cpu_in_panic() &&
> > + READ_ONCE(kdb_printf_cpu) !=
> > raw_smp_processor_id() &&
>
> This needs some sort of ifdef CONFIG_KGDB_KDB wrapped around it.
> Maybe
> it would be cleaner to have some macro.
Ouch.. that's true!
>
> #ifdef CONFIG_KGDB_KDB
> #define KGDB_IS_ACTIVE() (READ_ONCE(kdb_printf_cpu) ==
> raw_smp_processor_id())
> #else
> #define KGDB_IS_ACTIVE() false
> #endif
>
> and then something like:
>
> if (other_cpu_in_panic() &&
> !KGDB_IS_ACTIVE() &&
> (!is_reacquire || cur->unsafe_takeover)) {
> return -EPERM;
> }
>
> Or however you prefer. We need to compile for !CONFIG_KGDB_KDB.
I like the idea! Let me prepare it for v4.
>
> John
next prev parent reply other threads:[~2025-09-05 18:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 18:33 [PATCH v3 0/4] Handle NBCON consoles on KDB Marcos Paulo de Souza
2025-09-02 18:33 ` [PATCH v3 1/4] printk: nbcon: Export console_is_usable Marcos Paulo de Souza
2025-09-05 13:48 ` Petr Mladek
2025-09-02 18:33 ` [PATCH v3 2/4] printk: nbcon: Introduce KDB helpers Marcos Paulo de Souza
2025-09-05 16:21 ` Petr Mladek
2025-09-08 12:09 ` John Ogness
2025-09-09 14:21 ` Petr Mladek
2025-09-09 14:38 ` John Ogness
2025-09-02 18:33 ` [PATCH v3 3/4] printk: nbcon: Allow KDB to acquire the NBCON context Marcos Paulo de Souza
2025-09-05 14:52 ` John Ogness
2025-09-05 18:30 ` Marcos Paulo de Souza [this message]
2025-09-08 15:23 ` Petr Mladek
2025-09-09 7:53 ` John Ogness
2025-09-08 15:14 ` Petr Mladek
2025-09-02 18:33 ` [PATCH v3 4/4] kdb: Adapt kdb_msg_write to work with NBCON consoles Marcos Paulo de Souza
2025-09-08 15:51 ` Petr Mladek
2025-09-08 19:27 ` Marcos Paulo de Souza
2025-09-09 7:57 ` John Ogness
2025-09-09 11:39 ` Marcos Paulo de Souza
2025-09-09 13:48 ` Petr Mladek
2025-09-09 14:23 ` John Ogness
2025-09-09 15:03 ` Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85defbcb97090bcfa0995bbd58f8e41d8288ca44.camel@suse.com \
--to=mpdesouza@suse.com \
--cc=danielt@kernel.org \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jason.wessel@windriver.com \
--cc=john.ogness@linutronix.de \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox