From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Benedikt Spranger <b.spranger@linutronix.de>,
Andrew Murray <amurray@thegoodpenguin.co.uk>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Russell King <linux@armlinux.org.uk>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rpi-kernel@lists.infradead.org,
linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH v2 3/4] printk: nbcon: move printk_delay to console emiting code
Date: Wed, 8 Jul 2026 16:26:18 +0200 [thread overview]
Message-ID: <ak5eCp5qw9LYrnAH@pathway.suse.cz> (raw)
In-Reply-To: <87qzldvqpm.fsf@jogness.linutronix.de>
On Wed 2026-07-08 10:25:17, John Ogness wrote:
> On 2026-07-07, Petr Mladek <pmladek@suse.com> wrote:
> > To summarize this discussion:
> >
> > + Benedikt would prefer to add the synchronous mode before
> > moving the delay from the printk() caller to the console emit
> > code path.
> >
> > + The delay in the printk() caller code path did not guarantee
> > the output but it increased the chance to see it.
> >
> > + The synchronous mode will be even more reliable than the delay
> > in printk() caller path.
> >
> > Please, let me know if I did not get it right,
> >
> > John, did you have any plan how to add the synchronous mode, please?
> > Does it look complicated?
> >
> > I guess that we would somehow need to "mis-use" the emergency
> > priority and force it everywhere by some global system setting.
>
> The synchronous mode would rely on the driver being nbcon. I envision
> something like this:
Thanks for sharing the code.
> ---- BEGIN SYNC IDEA ----
> --- a/kernel/printk/nbcon.c
> +++ b/kernel/printk/nbcon.c
> @@ -1200,7 +1200,7 @@ static bool nbcon_kthread_should_wakeup(struct console *con, struct nbcon_contex
> cookie = console_srcu_read_lock();
>
> flags = console_srcu_read_flags(con);
> - if (console_is_usable(con, flags, false)) {
> + if (!(flags & CON_SYNC) && console_is_usable(con, flags, false)) {
The dependency on con->flags means that the sync mode can be entered
only in task context where synchronize_srcu() can be called. It might
be good enough. But I am afraid that people are creative and would
like to have even atomic variant sooner or later.
Also it will do the flush in NORMAL_PRIO which is good. But it might
fail to get the context ownership when it is blocked, for example,
by uart_port_lock() which might be even sleepable context in
PREEMPT_RT kernel.
> /* Bring the sequence in @ctxt up to date */
> ctxt->seq = nbcon_seq_read(con);
>
> ---- END SYNC IDEA ----
>
> BTW: The sync mode is the final piece so that PeterZ can start using
> mainline code for debugging by serial instead of his own workaround [0].
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=debug/experimental
I see.
Best Regards,
Petr
next prev parent reply other threads:[~2026-07-08 14:26 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 16:35 [PATCH v2 0/4] printk: nbcon: deprecate boot_delay in favour of printk_delay Andrew Murray
2026-06-30 16:35 ` [PATCH v2 1/4] printk: remove BOOT_PRINTK_DELAY config option Andrew Murray
2026-06-30 17:08 ` sashiko-bot
2026-06-30 16:35 ` [PATCH v2 2/4] printk: deprecate boot_delay in favour of printk_delay Andrew Murray
2026-06-30 16:49 ` sashiko-bot
2026-07-08 15:01 ` Petr Mladek
2026-07-09 12:32 ` Andrew Murray
2026-07-09 14:26 ` Petr Mladek
2026-07-09 14:48 ` Andrew Murray
2026-06-30 16:35 ` [PATCH v2 3/4] printk: nbcon: move printk_delay to console emiting code Andrew Murray
2026-06-30 17:09 ` sashiko-bot
2026-07-03 13:03 ` John Ogness
2026-07-03 12:57 ` John Ogness
2026-07-07 15:31 ` Petr Mladek
2026-07-08 10:36 ` John Ogness
2026-07-08 14:00 ` Petr Mladek
2026-07-09 15:27 ` Andrew Murray
2026-07-09 15:01 ` Andrew Murray
2026-07-03 14:56 ` Benedikt Spranger
2026-07-06 17:05 ` Andrew Murray
2026-07-07 7:34 ` John Ogness
2026-07-07 12:54 ` Benedikt Spranger
2026-07-07 15:04 ` Petr Mladek
2026-07-08 8:19 ` John Ogness
2026-07-08 14:26 ` Petr Mladek [this message]
2026-07-08 14:53 ` John Ogness
2026-07-08 15:09 ` Petr Mladek
2026-07-08 15:24 ` John Ogness
2026-07-09 14:27 ` Andrew Murray
2026-07-09 15:21 ` John Ogness
2026-06-30 16:36 ` [PATCH v2 4/4] Documentation/kernel-parameters: add/update printk_delay/boot_delay Andrew Murray
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=ak5eCp5qw9LYrnAH@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=amurray@thegoodpenguin.co.uk \
--cc=b.spranger@linutronix.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=corbet@lwn.net \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux@armlinux.org.uk \
--cc=rdunlap@infradead.org \
--cc=rjui@broadcom.com \
--cc=rostedt@goodmis.org \
--cc=sbranden@broadcom.com \
--cc=senozhatsky@chromium.org \
--cc=skhan@linuxfoundation.org \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.