Re: [PATCH v8 3/3] printk: fix double printing with earlycon

2017-04-05 Thread Aleksey Makarov
On 04/04/2017 02:12 PM, Petr Mladek wrote: On Thu 2017-03-30 14:55:46, Sergey Senozhatsky wrote: On (03/28/17 14:56), Petr Mladek wrote: [..] Alekesey, any chance to use the global variable to count used or point to the last element? I know that you have already spent a lot of time with i

Re: [PATCH v8 3/3] printk: fix double printing with earlycon

2017-04-04 Thread Petr Mladek
On Thu 2017-03-30 14:55:46, Sergey Senozhatsky wrote: > On (03/28/17 14:56), Petr Mladek wrote: > [..] > > > > Is it better? If not, I will send a version with console_cmdline_last. > > > > > > personally I'm fine with the nested loop. the latest version > > > "for (last = MAX_CMDLINECONSOLES -

Re: [PATCH v8 3/3] printk: fix double printing with earlycon

2017-03-29 Thread Sergey Senozhatsky
On (03/28/17 14:56), Petr Mladek wrote: [..] > > > Is it better? If not, I will send a version with console_cmdline_last. > > > > personally I'm fine with the nested loop. the latest version > > "for (last = MAX_CMDLINECONSOLES - 1; last >= 0;..." > > > > is even easier to read. > > The num

Re: [PATCH v8 3/3] printk: fix double printing with earlycon

2017-03-28 Thread Petr Mladek
On Tue 2017-03-28 11:04:04, Sergey Senozhatsky wrote: > On (03/27/17 19:28), Aleksey Makarov wrote: > [..] > > > > + /* > > > > +* Maintain an invariant that will help to find > > > > if > > > > +* the matching console is prefer

Re: [PATCH v8 3/3] printk: fix double printing with earlycon

2017-03-27 Thread Sergey Senozhatsky
On (03/27/17 19:28), Aleksey Makarov wrote: [..] > > > + /* > > > + * Maintain an invariant that will help to find if > > > + * the matching console is preferred, see > > > + * register_console(): > > > + * > > > +

Re: [PATCH v8 3/3] printk: fix double printing with earlycon

2017-03-27 Thread Aleksey Makarov
On 03/27/2017 05:14 PM, Petr Mladek wrote: On Mon 2017-03-20 13:03:00, Aleksey Makarov wrote: [..] diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index fd752f0c8ef1..462036e7a767 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1909,8 +1909,28 @@ static int

Re: [PATCH v8 3/3] printk: fix double printing with earlycon

2017-03-27 Thread Petr Mladek
On Mon 2017-03-20 13:03:00, Aleksey Makarov wrote: > If a console was specified by ACPI SPCR table _and_ command line > parameters like "console=ttyAMA0" _and_ "earlycon" were specified, > then log messages appear twice. > > The root cause is that the code traverses the list of specified > console

[PATCH v8 3/3] printk: fix double printing with earlycon

2017-03-20 Thread Aleksey Makarov
If a console was specified by ACPI SPCR table _and_ command line parameters like "console=ttyAMA0" _and_ "earlycon" were specified, then log messages appear twice. The root cause is that the code traverses the list of specified consoles (the `console_cmdline` array) and stops at the first match. B