[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aR31JoSpbap1S3xJ@pathway.suse.cz>
Date: Wed, 19 Nov 2025 17:49:42 +0100
From: Petr Mladek <pmladek@...e.com>
To: Chris Down <chris@...isdown.name>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
John Ogness <john.ogness@...utronix.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Tony Lindgren <tony.lindgren@...ux.intel.com>, kernel-team@...com
Subject: Re: [PATCH v7 03/13] printk: console: Implement core per-console
loglevel infrastructure
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@...e.com>
Best Regards,
Petr
Powered by blists - more mailing lists