From: Marcos Paulo de Souza <mpdesouza@suse.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
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,
Marcos Paulo de Souza <mpdesouza@suse.com>
Subject: [PATCH v3 0/4] Handle NBCON consoles on KDB
Date: Tue, 02 Sep 2025 15:33:51 -0300 [thread overview]
Message-ID: <20250902-nbcon-kgdboc-v3-0-cd30a8106f1c@suse.com> (raw)
These changes reached v3 (since the first version was tagged as v2 by me...),
thanks to all reviewers for the suggestions and questions about the code.
A new patch was introduced this time (3/4), adding an exception to nbcon
code when trying to acquire the context of a console when KDB is running,
suggested by John and Petr. Thanks a lot!
Testing
-------
I did the tests using qemu and reapplying commit f79b163c4231
('Revert "serial: 8250: Switch to nbcon console"') created originally by
John, just to exercise the common 8250 serial from qemu. The commit can
be checked on [1]. I had to solve some conflicts since the code has been
reworked after the commit was reverted.
Without the patches, I can't see any mirrored messages on the NBCON
console when KDB is triggered. With the patches I can see the messages.
[1]: https://github.com/marcosps/linux/commit/618bd49f8533db85d9c322f9ad1cb0da22aca9ee
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
Changes in v3:
- Only call nbcon_context_release if nbcon_context_exit_unsafe returns true (John Ogness)
- Dropped the prototype of console_is_usable from kernel/printk/internal. (Petr Mladek)
- Add comments to the new functions introduced (Petr Mladek)
- Flush KDB console on nbcon_kdb_release (Petr Mladek)
- Add an exception for KDB on nbcon_context_try_acquire_direct (John Ogness and Petr Mladek)
- Link to v2: https://lore.kernel.org/r/20250811-nbcon-kgdboc-v2-0-c7c72bcdeaf6@suse.com
Changes in v2:
- Set by mistake ..
- Link to v1: https://lore.kernel.org/r/20250713-nbcon-kgdboc-v1-0-51eccd9247a8@suse.com
---
Marcos Paulo de Souza (4):
printk: nbcon: Export console_is_usable
printk: nbcon: Introduce KDB helpers
printk: nbcon: Allow KDB to acquire the NBCON context
kdb: Adapt kdb_msg_write to work with NBCON consoles
include/linux/console.h | 50 +++++++++++++++++++++++++++++++++
kernel/debug/kdb/kdb_io.c | 46 +++++++++++++++++++++----------
kernel/printk/internal.h | 44 -----------------------------
kernel/printk/nbcon.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 151 insertions(+), 59 deletions(-)
---
base-commit: 618bd49f8533db85d9c322f9ad1cb0da22aca9ee
change-id: 20250713-nbcon-kgdboc-efcfc37fde46
Best regards,
--
Marcos Paulo de Souza <mpdesouza@suse.com>
next reply other threads:[~2025-09-02 18:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 18:33 Marcos Paulo de Souza [this message]
2025-09-02 18:33 ` [PATCH v3 1/4] printk: nbcon: Export console_is_usable Marcos Paulo de Souza
2025-09-02 18:33 ` [PATCH v3 2/4] printk: nbcon: Introduce KDB helpers Marcos Paulo de Souza
2025-09-02 18:33 ` [PATCH v3 3/4] printk: nbcon: Allow KDB to acquire the NBCON context Marcos Paulo de Souza
2025-09-02 18:33 ` [PATCH v3 4/4] kdb: Adapt kdb_msg_write to work with NBCON consoles Marcos Paulo de Souza
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=20250902-nbcon-kgdboc-v3-0-cd30a8106f1c@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;
as well as URLs for NNTP newsgroup(s).