From: Petr Mladek <pmladek@suse•com>
To: Marcos Paulo de Souza <mpdesouza@suse•com>
Cc: Richard Weinberger <richard@nod•at>,
Anton Ivanov <anton.ivanov@cambridgegreys•com>,
Johannes Berg <johannes@sipsolutions•net>,
Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
Jason Wessel <jason.wessel@windriver•com>,
Daniel Thompson <danielt@kernel•org>,
Douglas Anderson <dianders@chromium•org>,
Steven Rostedt <rostedt@goodmis•org>,
John Ogness <john.ogness@linutronix•de>,
Sergey Senozhatsky <senozhatsky@chromium•org>,
Jiri Slaby <jirislaby@kernel•org>,
Breno Leitao <leitao@debian•org>,
Andrew Lunn <andrew+netdev@lunn•ch>,
"David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
Geert Uytterhoeven <geert@linux-m68k•org>,
Kees Cook <kees@kernel•org>, Tony Luck <tony.luck@intel•com>,
"Guilherme G. Piccoli" <gpiccoli@igalia•com>,
Madhavan Srinivasan <maddy@linux•ibm.com>,
Michael Ellerman <mpe@ellerman•id.au>,
Nicholas Piggin <npiggin@gmail•com>,
Christophe Leroy <christophe.leroy@csgroup•eu>,
Andreas Larsson <andreas@gaisler•com>,
Alexander Shishkin <alexander.shishkin@linux•intel.com>,
Maxime Coquelin <mcoquelin.stm32@gmail•com>,
Alexandre Torgue <alexandre.torgue@foss•st.com>,
Jacky Huang <ychuang3@nuvoton•com>,
Shan-Chun Hung <schung@nuvoton•com>,
Laurentiu Tudor <laurentiu.tudor@nxp•com>,
linux-um@lists•infradead.org, linux-kernel@vger•kernel.org,
kgdb-bugreport@lists•sourceforge.net,
linux-serial@vger•kernel.org, netdev@vger•kernel.org,
linux-m68k@lists•linux-m68k.org, linux-hardening@vger•kernel.org,
linuxppc-dev@lists•ozlabs.org, sparclinux@vger•kernel.org,
linux-stm32@st-md-mailman•stormreply.com,
linux-arm-kernel@lists•infradead.org,
linux-fsdevel@vger•kernel.org
Subject: Re: [PATCH 10/19] fs: pstore: platform: Migrate to register_console_force helper
Date: Thu, 15 Jan 2026 12:05:51 +0100 [thread overview]
Message-ID: <aWjKD4jv8CySV0Rj@pathway.suse.cz> (raw)
In-Reply-To: <20251227-printk-cleanup-part3-v1-10-21a291bcf197@suse.com>
On Sat 2025-12-27 09:16:17, Marcos Paulo de Souza wrote:
> The register_console_force function was introduced to register consoles
> even on the presence of default consoles, replacing the CON_ENABLE flag
> that was forcing the same behavior.
>
> No functional changes.
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -418,10 +418,10 @@ static void pstore_register_console(void)
> sizeof(pstore_console.name));
> /*
> * Always initialize flags here since prior unregister_console()
> - * calls may have changed settings (specifically CON_ENABLED).
> + * calls may have changed settings.
> */
> - pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME;
> - register_console(&pstore_console);
> + pstore_console.flags = CON_PRINTBUFFER | CON_ANYTIME;
As the original comment suggests, this was done primary because
of CON_ENABLED flag. Otherwise, the console was not registered again.
register_console() might remove CON_PRINTBUFFER when there was
a boot console and the newly registered console will get associated
with /dev/console. But I consider this a corner case. Other console
drivers ignore this scenario.
I suggest to define the two flags statically in
struct console pstore_console definition as it is done by
other console drivers. Remove this explicit dynamic assigment.
And add the following into the commit message:
<proposal>
Define the remaining console flags statically in the structure definition
as it is done by other console drivers.
The flags were re-defined primary because of the CON_ENABLED flag.
Otherwise, the re-registration failed.
The CON_PRINTBUFFER might get cleared when a boot console was registered
and the pstrore console got associated with /dev/console. In this
case, the pstore console would not re-play the entire ring buffer
on re-registration. But it is a corner case. And it actually might
be a desired behavior.
</proposal>
Otherwise, the next generations of kernel developers might think that
the re-assigment was there because of CON_PRINTBUFFER flag.
And it might cause non-necessary headaches ;-)
> + register_console_force(&pstore_console);
> }
>
> static void pstore_unregister_console(void)
Best Regards,
Petr
next prev parent reply other threads:[~2026-01-15 11:06 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-27 12:16 [PATCH 00/19] printk cleanup - part 3 Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 01/19] printk/nbcon: Use an enum to specify the required callback in console_is_usable() Marcos Paulo de Souza
2026-01-13 16:25 ` Petr Mladek
2026-01-30 15:31 ` John Ogness
2025-12-27 12:16 ` [PATCH 02/19] printk: Introduce console_is_nbcon Marcos Paulo de Souza
2026-01-13 17:37 ` Petr Mladek
2026-01-30 15:50 ` John Ogness
2025-12-27 12:16 ` [PATCH 03/19] printk: Drop flags argument from console_is_usable Marcos Paulo de Souza
2026-01-14 8:44 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 04/19] printk: Reintroduce consoles_suspended global state Marcos Paulo de Souza
2026-01-14 13:12 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 05/19] printk: Add more context to suspend/resume functions Marcos Paulo de Souza
2026-01-14 13:20 ` Petr Mladek
2026-01-30 17:27 ` John Ogness
2025-12-27 12:16 ` [PATCH 06/19] printk: Introduce register_console_force Marcos Paulo de Souza
2026-01-14 14:22 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 07/19] drivers: netconsole: Migrate to register_console_force helper Marcos Paulo de Souza
2026-01-15 10:16 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 08/19] debug: debug_core: " Marcos Paulo de Souza
2026-01-15 10:20 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 09/19] m68k: emu: nfcon.c: " Marcos Paulo de Souza
2026-01-15 10:26 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 10/19] fs: pstore: platform: " Marcos Paulo de Souza
2026-01-15 11:05 ` Petr Mladek [this message]
2025-12-27 12:16 ` [PATCH 11/19] powerpc: kernel: udbg: " Marcos Paulo de Souza
2026-01-15 12:13 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 12/19] sparc: kernel: btext: " Marcos Paulo de Souza
2026-01-15 12:14 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 13/19] um: drivers: mconsole_kern.c: " Marcos Paulo de Souza
2026-01-15 12:24 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 14/19] drivers: hwtracing: stm: console.c: " Marcos Paulo de Souza
2026-01-15 12:29 ` Petr Mladek
2026-01-16 13:04 ` Alexander Shishkin
2026-01-16 13:54 ` Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 15/19] drivers: tty: serial: mux.c: " Marcos Paulo de Souza
2026-01-16 9:59 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 16/19] drivers: tty: serial: ma35d1_serial: " Marcos Paulo de Souza
2026-01-15 16:28 ` Petr Mladek
2025-12-27 12:16 ` [PATCH 17/19] drivers: tty: ehv_bytechan: " Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 18/19] drivers: braille: console: Drop CON_ENABLED console flag Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 19/19] printk: Remove CON_ENABLED flag Marcos Paulo de Souza
2026-01-05 12:52 ` [PATCH 00/19] printk cleanup - part 3 Daniel Thompson
2026-01-05 14:08 ` Daniel Thompson
2026-01-13 12:41 ` Marcos Paulo de Souza
2026-01-14 0:32 ` Marcos Paulo de Souza
2026-01-14 8:20 ` Petr Mladek
2026-01-14 16:38 ` Daniel Thompson
2026-01-07 10:22 ` Andreas Larsson
2026-01-12 17:53 ` Marcos Paulo de Souza
2026-02-20 11:43 ` 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=aWjKD4jv8CySV0Rj@pathway.suse.cz \
--to=pmladek@suse$(echo .)com \
--cc=alexander.shishkin@linux$(echo .)intel.com \
--cc=alexandre.torgue@foss$(echo .)st.com \
--cc=andreas@gaisler$(echo .)com \
--cc=andrew+netdev@lunn$(echo .)ch \
--cc=anton.ivanov@cambridgegreys$(echo .)com \
--cc=christophe.leroy@csgroup$(echo .)eu \
--cc=danielt@kernel$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=dianders@chromium$(echo .)org \
--cc=edumazet@google$(echo .)com \
--cc=geert@linux-m68k$(echo .)org \
--cc=gpiccoli@igalia$(echo .)com \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=jason.wessel@windriver$(echo .)com \
--cc=jirislaby@kernel$(echo .)org \
--cc=johannes@sipsolutions$(echo .)net \
--cc=john.ogness@linutronix$(echo .)de \
--cc=kees@kernel$(echo .)org \
--cc=kgdb-bugreport@lists$(echo .)sourceforge.net \
--cc=kuba@kernel$(echo .)org \
--cc=laurentiu.tudor@nxp$(echo .)com \
--cc=leitao@debian$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-fsdevel@vger$(echo .)kernel.org \
--cc=linux-hardening@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-m68k@lists$(echo .)linux-m68k.org \
--cc=linux-serial@vger$(echo .)kernel.org \
--cc=linux-stm32@st-md-mailman$(echo .)stormreply.com \
--cc=linux-um@lists$(echo .)infradead.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=maddy@linux$(echo .)ibm.com \
--cc=mcoquelin.stm32@gmail$(echo .)com \
--cc=mpdesouza@suse$(echo .)com \
--cc=mpe@ellerman$(echo .)id.au \
--cc=netdev@vger$(echo .)kernel.org \
--cc=npiggin@gmail$(echo .)com \
--cc=pabeni@redhat$(echo .)com \
--cc=richard@nod$(echo .)at \
--cc=rostedt@goodmis$(echo .)org \
--cc=schung@nuvoton$(echo .)com \
--cc=senozhatsky@chromium$(echo .)org \
--cc=sparclinux@vger$(echo .)kernel.org \
--cc=tony.luck@intel$(echo .)com \
--cc=ychuang3@nuvoton$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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