From: Petr Mladek <pmladek@suse.com>
To: Chris Down <chris@chrisdown.name>
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Tony Lindgren <tony.lindgren@linux.intel.com>,
kernel-team@fb.com
Subject: Re: [PATCH v7 03/13] printk: console: Implement core per-console loglevel infrastructure
Date: Wed, 19 Nov 2025 17:49:42 +0100 [thread overview]
Message-ID: <aR31JoSpbap1S3xJ@pathway.suse.cz> (raw)
In-Reply-To: <201aa88f5c476ba56aa23183d74643275f8b2b41.1763492585.git.chris@chrisdown.name>
On Wed 2025-11-19 03:07:06, Chris Down wrote:
> This commit adds the internal infrastructure to support per-console
> log levels, which will be configurable through sysfs and the kernel
> command line in future commits.
>
> --- a/include/linux/console.h
> +++ b/include/linux/console.h
> @@ -518,11 +521,6 @@ extern struct hlist_head console_list;
> static inline short console_srcu_read_flags(const struct console *con)
> {
> WARN_ON_ONCE(!console_srcu_read_lock_is_held());
> -
> - /*
> - * The READ_ONCE() matches the WRITE_ONCE() when @flags are modified
> - * for registered consoles with console_srcu_write_flags().
> - */
> return data_race(READ_ONCE(con->flags));
> }
As you have already pointed out, the above change looks unintentional.
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -3835,8 +3967,12 @@ static int try_enable_preferred_console(struct console *newcon,
> * without matching. Accept the pre-enabled consoles only when match()
> * and setup() had a chance to be called.
> */
> - if (newcon->flags & CON_ENABLED && c->user_specified == user_specified)
> + if (newcon->flags & CON_ENABLED && c->user_specified == user_specified) {
> + /* Ensure level is initialized for pre-enabled consoles */
> + if (newcon->level == 0)
> + newcon->level = LOGLEVEL_DEFAULT;
This change does not harm. But it seems to be redundant after all.
The same check/set is done also in register_console(), see below.
> return 0;
> + }
>
> return -ENOENT;
> }
> @@ -4039,6 +4175,14 @@ void register_console(struct console *newcon)
> }
>
> newcon->dropped = 0;
> +
> + /*
> + * Don't unconditionally overwrite, it may have been set on the command
> + * line already.
> + */
> + if (newcon->level == 0)
> + newcon->level = LOGLEVEL_DEFAULT;
> +
> init_seq = get_init_console_seq(newcon, bootcon_registered);
>
> if (newcon->flags & CON_NBCON) {
Otherwise, it looks good to me. With two hunks removed, feel free to
use:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
next prev parent reply other threads:[~2025-11-19 16:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 19:06 [PATCH v7 00/13] printk: console: Per-console loglevels Chris Down
2025-11-18 19:06 ` [PATCH v7 01/13] printk: Avoid delaying messages that aren't solicited by any console Chris Down
2025-11-18 19:33 ` Chris Down
2025-11-19 15:46 ` Petr Mladek
2025-11-18 19:06 ` [PATCH v7 02/13] printk: Use effective loglevel for suppression and extended console state Chris Down
2025-11-18 19:07 ` [PATCH v7 03/13] printk: console: Implement core per-console loglevel infrastructure Chris Down
2025-11-18 19:34 ` Chris Down
2025-11-19 16:49 ` Petr Mladek [this message]
2025-11-18 19:07 ` [PATCH v7 04/13] printk: Ignore per-console loglevel in sysrq Chris Down
2025-11-19 16:51 ` Petr Mladek
2025-11-18 19:07 ` [PATCH v7 05/13] printk: Add synchronisation for concurrent console state changes Chris Down
2025-11-19 16:58 ` Petr Mladek
2025-11-18 19:07 ` [PATCH v7 06/13] printk: Support toggling per-console loglevel via syslog() and cmdline Chris Down
2025-11-20 10:05 ` Petr Mladek
2025-11-18 19:07 ` [PATCH v7 07/13] printk: console: Introduce sysfs interface for per-console loglevels Chris Down
2025-11-20 16:50 ` Petr Mladek
2025-11-21 11:38 ` Petr Mladek
2025-11-18 19:07 ` [PATCH v7 08/13] printk: Constrain hardware-addressed console checks to name position Chris Down
2025-11-18 19:07 ` [PATCH v7 09/13] printk: Support setting initial console loglevel via console= on cmdline Chris Down
2025-11-21 14:05 ` Petr Mladek
2025-11-18 19:07 ` [PATCH v7 10/13] printk: Add sysctl interface to set global loglevels Chris Down
2025-11-21 14:23 ` Petr Mladek
2025-11-18 19:08 ` [PATCH v7 11/13] printk: docs: Add comprehensive guidance for per-console loglevels Chris Down
2025-11-21 15:52 ` Petr Mladek
2025-11-23 21:21 ` John Ogness
2025-11-18 19:08 ` [PATCH v7 12/13] printk: Deprecate the kernel.printk sysctl interface Chris Down
2025-11-18 19:08 ` [PATCH v7 13/13] printk: Purge default_console_loglevel Chris Down
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=aR31JoSpbap1S3xJ@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=chris@chrisdown.name \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tony.lindgren@linux.intel.com \
/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