From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
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>,
linux-kernel@vger.kernel.org,
kgdb-bugreport@lists.sourceforge.net
Subject: Re: [PATCH v5 2/5] printk: nbcon: Introduce KDB helpers
Date: Mon, 6 Oct 2025 15:58:22 +0200 [thread overview]
Message-ID: <aOPK_jgFJwM0TWTY@pathway.suse.cz> (raw)
In-Reply-To: <84h5wihdqu.fsf@jogness.linutronix.de>
On Wed 2025-10-01 17:02:41, John Ogness wrote:
> On 2025-09-30, Marcos Paulo de Souza <mpdesouza@suse.com> wrote:
> > diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
> > index 558ef31779760340ce42608294d91d5401239f1d..c23abed5933527cb7c6bcc42057fadbb44a43446 100644
> > --- a/kernel/printk/nbcon.c
> > +++ b/kernel/printk/nbcon.c
> > +/**
> > + * nbcon_kdb_release - Exit unsafe section and release the nbcon console
> > + *
> > + * @wctxt: The nbcon write context initialized by a successful
> > + * nbcon_kdb_try_acquire()
> > + *
> > + * Context: Under console_srcu_read_lock() for emiting a single kdb message
>
> emitting ---^^^^^^^
>
> > + * using the given con->write_atomic() callback. Can be called
> > + * only when the console is usable at the moment.
>
> I do not think the "Context" is relevant. It must be called if
> a previous call to nbcon_kdb_try_acquire() was successful.
Makes sense. I am fine with removing the "Context:" secion completely
from nbcon_kdb_release().
Just to be sure. I think that we do not need to mention that it can
be called only when nbcon_kdb_try_acquire() succeeded. It is kind
of obvious.
Best Regards,
Petr
> > + */
> > +void nbcon_kdb_release(struct nbcon_write_context *wctxt)
> > +{
> > + struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt);
> > +
> > + if (!nbcon_context_exit_unsafe(ctxt))
> > + return;
> > +
> > + nbcon_context_release(ctxt);
> > +
> > + /*
> > + * Flush any new printk() messages added when the console was blocked.
> > + * Only the console used by the given write context was blocked.
> > + * 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);
>
> This can all be one line. 100 characters is the official limit for code.
>
> > +}
next prev parent reply other threads:[~2025-10-06 13:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-30 17:21 [PATCH v5 0/5] Handle NBCON consoles on KDB Marcos Paulo de Souza
2025-09-30 17:21 ` [PATCH v5 1/5] printk: nbcon: Export console_is_usable Marcos Paulo de Souza
2025-10-01 14:36 ` John Ogness
2025-09-30 17:21 ` [PATCH v5 2/5] printk: nbcon: Introduce KDB helpers Marcos Paulo de Souza
2025-10-01 14:56 ` John Ogness
2025-10-02 11:23 ` Marcos Paulo de Souza
2025-10-02 19:03 ` Marcos Paulo de Souza
2025-10-06 8:31 ` John Ogness
2025-10-06 13:58 ` Petr Mladek [this message]
2025-09-30 17:21 ` [PATCH v5 3/5] printk: nbcon: Allow KDB to acquire the NBCON context Marcos Paulo de Souza
2025-10-01 15:05 ` John Ogness
2025-09-30 17:21 ` [PATCH v5 4/5] printk: nbcon: Export nbcon_write_context_set_buf Marcos Paulo de Souza
2025-10-01 15:08 ` John Ogness
2025-09-30 17:21 ` [PATCH v5 5/5] kdb: Adapt kdb_msg_write to work with NBCON consoles Marcos Paulo de Souza
2025-10-01 15:21 ` John Ogness
2025-10-02 14:01 ` [PATCH v5 0/5] Handle NBCON consoles on KDB Daniel Thompson
2025-10-02 16:20 ` 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=aOPK_jgFJwM0TWTY@pathway.suse.cz \
--to=pmladek@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=mpdesouza@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 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.