[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yy88ZIIzEXtfb+m6@p100>
Date: Sat, 24 Sep 2022 19:20:36 +0200
From: Helge Deller <deller@....de>
To: John Ogness <john.ogness@...utronix.de>
Cc: Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
Helge Deller <deller@....de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-parisc@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH printk 11/18] printk: Convert console_drivers list to
hlist
Hi John,
* John Ogness <john.ogness@...utronix.de>:
> From: Thomas Gleixner <tglx@...utronix.de>
>
> Replace the open coded single linked list with a hlist so a conversion to
> SRCU protected list walks can reuse the existing primitives.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: John Ogness <john.ogness@...utronix.de>
> ---
> arch/parisc/kernel/pdc_cons.c | 19 +++----
> fs/proc/consoles.c | 5 +-
> include/linux/console.h | 15 ++++--
> kernel/printk/printk.c | 99 +++++++++++++++++++----------------
> 4 files changed, 75 insertions(+), 63 deletions(-)
>
> diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
> index 9a0c0932d2f9..3f9abf0263ee 100644
> --- a/arch/parisc/kernel/pdc_cons.c
> +++ b/arch/parisc/kernel/pdc_cons.c
> @@ -272,15 +267,17 @@ void pdc_console_restart(bool hpmc)
> if (pdc_console_initialized)
> return;
>
> - if (!hpmc && console_drivers)
> + if (!hpmc && !hlist_empty(&console_list))
> return;
>
> /* If we've already seen the output, don't bother to print it again */
> - if (console_drivers != NULL)
> + if (!hlist_empty(&console_list))
> pdc_cons.flags &= ~CON_PRINTBUFFER;
>
> - while ((console = console_drivers) != NULL)
> - unregister_console(console_drivers);
> + while (!hlist_empty(&console_list)) {
> + unregister_console(READ_ONCE(hlist_entry(console_list.first,
> + struct console, node)));
> + }
>
> /* force registering the pdc console */
> pdc_console_init_force();
Thanks for doing this!!
I had to add the hunks below on top of your patch to make it compile
and boot sucessfully on parisc.
Maybe you could fold those into your patch?
Thanks!
Helge
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 3f9abf0263ee..f15998aa47a8 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -262,8 +262,6 @@ void __init pdc_console_init(void)
*/
void pdc_console_restart(bool hpmc)
{
- struct console *console;
-
if (pdc_console_initialized)
return;
@@ -275,8 +273,8 @@ void pdc_console_restart(bool hpmc)
pdc_cons.flags &= ~CON_PRINTBUFFER;
while (!hlist_empty(&console_list)) {
- unregister_console(READ_ONCE(hlist_entry(console_list.first,
- struct console, node)));
+ unregister_console(hlist_entry(console_list.first,
+ struct console, node));
}
/* force registering the pdc console */
Powered by blists - more mailing lists