Re: [Kgdb-bugreport] [PATCH printk v3 15/40] kdb: use srcu console list iterator

2022-11-09 Thread Petr Mladek via Kgdb-bugreport
On Wed 2022-11-09 10:33:55, John Ogness wrote: > Hi Daniel, > > On 2022-11-09, Daniel Thompson wrote: > >> + /* > >> + * The console_srcu_read_lock() only provides safe console list > >> + * traversal. The use of the ->write() callback relies on all other > >> + * CPUs being stopped at the

Re: [Kgdb-bugreport] [PATCH printk v3 12/40] tty: serial: kgdboc: document console_lock usage

2022-11-09 Thread Petr Mladek via Kgdb-bugreport
On Mon 2022-11-07 15:22:10, John Ogness wrote: > kgdboc_earlycon_init() uses the console_lock to ensure that no consoles > are unregistered until the kgdboc_earlycon is setup. This is necessary > because the trapping of the exit() callback assumes that the exit() > callback is not called before the

Re: [Kgdb-bugreport] [PATCH printk v3 10/40] kdb: kdb_io: use console_is_enabled()

2022-11-09 Thread Petr Mladek via Kgdb-bugreport
On Mon 2022-11-07 15:22:08, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness > Reviewed-by: Petr Mladek > Reviewed-by: Douglas Anderson > --- > kernel/debug/kdb/kdb_io.c | 2 +- > 1 file changed, 1 insertion(+), 1 delet

Re: [Kgdb-bugreport] [PATCH printk v3 36/40] tty: serial: kgdboc: use console_list_lock for list traversal

2022-11-09 Thread John Ogness
On 2022-11-09, Daniel Thompson wrote: >> @@ -463,9 +476,14 @@ static void kgdboc_earlycon_pre_exp_handler(void) >> * serial drivers might be OK with this, print a warning once per >> * boot if we detect this case. >> */ >> -for_each_console(con) >> +cookie = console_srcu_

Re: [Kgdb-bugreport] [PATCH printk v3 15/40] kdb: use srcu console list iterator

2022-11-09 Thread John Ogness
Hi Daniel, On 2022-11-09, Daniel Thompson wrote: >> +/* >> + * The console_srcu_read_lock() only provides safe console list >> + * traversal. The use of the ->write() callback relies on all other >> + * CPUs being stopped at the moment and console drivers being able to >> + *

Re: [Kgdb-bugreport] [PATCH printk v3 36/40] tty: serial: kgdboc: use console_list_lock for list traversal

2022-11-09 Thread Daniel Thompson
On Mon, Nov 07, 2022 at 03:22:34PM +0106, John Ogness wrote: > configure_kgdboc() uses the console_lock for console list iteration. Use > the console_list_lock instead because list synchronization responsibility > will be removed from the console_lock in a later change. > > The SRCU iterator could

Re: [Kgdb-bugreport] [PATCH printk v3 15/40] kdb: use srcu console list iterator

2022-11-09 Thread Daniel Thompson
On Mon, Nov 07, 2022 at 03:22:13PM +0106, John Ogness wrote: > Guarantee safe iteration of the console list by using SRCU. > > Signed-off-by: John Ogness > --- > kernel/debug/kdb/kdb_io.c | 12 +++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/kernel/debug/kdb/kdb_io

Re: [Kgdb-bugreport] [PATCH printk v3 10/40] kdb: kdb_io: use console_is_enabled()

2022-11-09 Thread Daniel Thompson
On Mon, Nov 07, 2022 at 03:22:08PM +0106, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness > Reviewed-by: Petr Mladek > Reviewed-by: Douglas Anderson Reviewed-by: Daniel Thompson Daniel.

Re: [Kgdb-bugreport] [PATCH printk v3 12/40] tty: serial: kgdboc: document console_lock usage

2022-11-09 Thread Daniel Thompson
On Mon, Nov 07, 2022 at 03:22:10PM +0106, John Ogness wrote: > kgdboc_earlycon_init() uses the console_lock to ensure that no consoles > are unregistered until the kgdboc_earlycon is setup. This is necessary > because the trapping of the exit() callback assumes that the exit() > callback is not cal

Re: [Kgdb-bugreport] [PATCH printk v3 02/40] serial: kgdboc: Lock console list in probe function

2022-11-09 Thread Daniel Thompson
On Mon, Nov 07, 2022 at 03:22:00PM +0106, John Ogness wrote: > From: Thomas Gleixner > > Unprotected list walks are not necessarily safe. > > Signed-off-by: Thomas Gleixner > Signed-off-by: John Ogness > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Douglas Anderson > Reviewed-by: Sergey Seno