Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-25 Thread Steven Rostedt
On Thu, 25 Apr 2019 11:20:03 +0200 Petr Mladek wrote: > > > > Petr, Steven, would you prefer to have it as two separate patches - one > > removes the comment; the other one moves pr_info("console enabled") - or > > as one patch? It's sort of trivial enough to be in just one patch, but > > I also

Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-25 Thread Sergey Senozhatsky
On (04/25/19 16:56), Sergey Senozhatsky wrote: > > Great idea! > > > > It would deserve a separate patch that moves the pr_info() > > and removes the invalid comment. > > > > Actually, the pr_info() would deserve a comment explaining > > why it should be called before console_unlock(). > > Good.

Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-25 Thread Petr Mladek
On Thu 2019-04-25 15:43:21, Sergey Senozhatsky wrote: > On (04/25/19 12:52), Sergey Senozhatsky wrote: > > > Could we remove it in this patch? It touches it indirectly anyway. > > > > Sure we can. > > > > We also can take extra care of pr_info("%sconsole [%s%d] enabled\n". > > Right now we do > >

Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-25 Thread Sergey Senozhatsky
On (04/25/19 09:50), Petr Mladek wrote: > > Sure we can. > > > > We also can take extra care of pr_info("%sconsole [%s%d] enabled\n". > > Right now we do > > > > ... > > console_unlock(); > > console_sysfs_notify(); > > > > pr_info("%sconsole [%s%d] enabled\n", > > > > > >

Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-25 Thread Petr Mladek
On Thu 2019-04-25 12:52:33, Sergey Senozhatsky wrote: > On (04/24/19 16:49), Petr Mladek wrote: > > > + if (bcon && (newcon->flags & (CON_CONSDEV|CON_BOOT)) == CON_CONSDEV) { > > > + console_lock(); > > > + /* > > > + * We need to iterate through all boot consoles, to make

Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-24 Thread Sergey Senozhatsky
On (04/25/19 12:52), Sergey Senozhatsky wrote: > > Could we remove it in this patch? It touches it indirectly anyway. > > Sure we can. > > We also can take extra care of pr_info("%sconsole [%s%d] enabled\n". > Right now we do > > ... > console_unlock(); > console_sysfs_notify()

Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-24 Thread Sergey Senozhatsky
On (04/24/19 16:49), Petr Mladek wrote: > > + if (bcon && (newcon->flags & (CON_CONSDEV|CON_BOOT)) == CON_CONSDEV) { > > + console_lock(); > > + /* > > +* We need to iterate through all boot consoles, to make > > * sure we print everything out, before

Re: [RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-24 Thread Petr Mladek
On Tue 2019-04-23 15:25:10, Sergey Senozhatsky wrote: > The following pattern is not completely safe: > > for_each_console(bcon) > if (bcon->flags & CON_BOOT) > unregister_console(bcon); > > Because, in theory, console drivers list and console drivers > can be modified

[RFC][PATCH 1/2] printk: lock console_sem before we unregister boot consoles

2019-04-22 Thread Sergey Senozhatsky
The following pattern is not completely safe: for_each_console(bcon) if (bcon->flags & CON_BOOT) unregister_console(bcon); Because, in theory, console drivers list and console drivers can be modified concurrently from another CPU. Take console_sem lock, which protects c