From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Breno Leitao <leitao@debian.org>, Mike Galbraith <efault@gmx.de>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH printk v2 1/1] printk: nbcon: Allow unsafe write_atomic() for panic
Date: Thu, 30 Oct 2025 16:03:17 +0100 [thread overview]
Message-ID: <aQN-NeWzlxtWDLXF@pathway.suse.cz> (raw)
In-Reply-To: <20251027161212.334219-2-john.ogness@linutronix.de>
On Mon 2025-10-27 17:18:03, John Ogness wrote:
> There may be console drivers that have not yet figured out a way
> to implement safe atomic printing (->write_atomic() callback).
> These drivers could choose to only implement threaded printing
> (->write_thread() callback), but then it is guaranteed that _no_
> output will be printed during panic. Not even attempted.
>
> As a result, developers may be tempted to implement unsafe
> ->write_atomic() callbacks and/or implement some sort of custom
> deferred printing trickery to try to make it work. This goes
> against the principle intention of the nbcon API as well as
> endangers other nbcon drivers that are doing things correctly
> (safely).
>
> As a compromise, allow nbcon drivers to implement unsafe
> ->write_atomic() callbacks by providing a new console flag
> CON_NBCON_ATOMIC_UNSAFE. When specified, the ->write_atomic()
> callback for that console will _only_ be called during the
> final "hope and pray" flush attempt at the end of a panic:
> nbcon_atomic_flush_unsafe().
>
> Signed-off-by: John Ogness <john.ogness@linutronix.de>
> Link: https://lore.kernel.org/lkml/b2qps3uywhmjaym4mht2wpxul4yqtuuayeoq4iv4k3zf5wdgh3@tocu6c7mj4lt
The patch looks good to me:
Reviewed-by: Petr Mladek <pmladek@suse.com>
That said, it needs one more hunk to fix build with the patchset
adding support for nbcon into kdb which is
in https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git/
It would fix the compilation problem reported by the robot:
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -1935,5 +1935,5 @@ void nbcon_kdb_release(struct nbcon_write_context *wctxt)
* The console was locked only when the write_atomic() callback
* was usable.
*/
- __nbcon_atomic_flush_pending_con(ctxt->console, prb_next_reserve_seq(prb), false);
+ __nbcon_atomic_flush_pending_con(ctxt->console, prb_next_reserve_seq(prb));
}
Also there is one trivial conflict with the new branch which is
preventing hardlockups in atomic flush which is
https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git/log/?h=rework/atomic-flush-hardlockup
Namely, it is the last patch which moves nbcon_context_try_acquire()
into to while cycle, see
https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git/commit/?h=rework/atomic-flush-hardlockup&id=d5d399efff65773ed82ddaf6c11a0fcfdb5eb029
Commit:
I am not sure how to move forward. IMHO, the original plan was to push
this patch together with the other netconsole-related changes. In this
case, the conflicts will need to be solved when merging pull requests
from netconsole and printk trees. Well, the conflicts are trivial.
Or I could push this patch via the printk tree and queue it for 6.19.
But this might be too late for netconsole.
It primary depends whether the netconsole side might be ready for 6.19
or if it could wait for 6.20.
Best Regards,
Petr
next prev parent reply other threads:[~2025-10-30 15:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 16:12 [PATCH printk v2 0/1] allow unsafe write_atomic() John Ogness
2025-10-27 16:12 ` [PATCH printk v2 1/1] printk: nbcon: Allow unsafe write_atomic() for panic John Ogness
2025-10-28 4:56 ` kernel test robot
2025-10-28 4:56 ` kernel test robot
2025-10-30 15:03 ` Petr Mladek [this message]
2025-10-31 8:56 ` John Ogness
2025-11-04 9:56 ` Breno Leitao
2025-11-07 13:56 ` Petr Mladek
2025-11-07 14:12 ` John Ogness
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=aQN-NeWzlxtWDLXF@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=efault@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--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