Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1640052

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

From Aleksey Makarov <aleksey.makarov@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v9 3/3] printk: fix double printing with earlycon
Date 2017-05-11 23:20 +0200
Message-ID <tG3F7-3bi-5@gated-at.bofh.it> (permalink)
References <tlevv-6jJ-5@gated-at.bofh.it> <tsZJ0-7kG-21@gated-at.bofh.it> <tF8GR-7BJ-5@gated-at.bofh.it> <tFRDY-3XM-7@gated-at.bofh.it> <tFRXk-44b-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 05/11/2017 11:41 AM, Sergey Senozhatsky wrote:
> On (05/11/17 17:24), Sergey Senozhatsky wrote:
>> On (05/09/17 10:29), Sabrina Dubroca wrote:
>> [..]
>>> That's caused a change of behavior in my qemu setup, with this cmdline
>>>
>>>      root=/dev/sda1 console=ttyS1 console=ttyS0
>>>
>>> Before, the kernel logs appeared on ttyS1, and I logged in with ttyS0
>>> (with my setup, ttyS1 is a file and ttyS0 is unix socket). Now, the
>>> kernel logs go to ttyS0. I need to swap the two console= parameters to
>>> restore behavior.
>>>
>>> There might be some other problem (in qemu?) though, because adding
>>> console=tty0 anywhere on that cmdline makes the logs appear on both
>>> tty0 and one ttyS* (but only one of them, and the ordering of the
>>> ttyS* matters).
>>
>> thanks for the report.
>>
>> so we have ttyS1 first and ttyS0 last.
>> after commit in question, register_console() iterates console_cmdline
>> in reverse order so we see ttyS0 first, then we hit `if (newcon->index < 0)'
>> condition, set newcon to ttyS0, because we iterate in reverse order now, and
>> break out. so we enable ttyS0, instead of ttyS1.
>>
>> previously, we iterated console_cmdline from index 0 and saw ttyS1 first.
>> so the same `if (newcon->index < 0)' condition would set newcone to ttyS1,
>> and, thus, we would enable ttyS1, not ttyS0.
> 
> Alexey,
> can we have preferred console at offset 0 (not at console_cmdline_cnt - 1)
> and restore the previous register_console() iteration order?

I don't quite understand what is the problem.  Give me more time please.
I hope I will be able to look at this on the weekend.

Thank you
Aleksey Makarov

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v9 3/3] printk: fix double printing with earlycon Sabrina Dubroca <sd@queasysnail.net> - 2017-05-09 10:30 +0200
  Re: [PATCH v9 3/3] printk: fix double printing with earlycon Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-05-11 10:30 +0200
    Re: [PATCH v9 3/3] printk: fix double printing with earlycon Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-05-11 10:50 +0200
      Re: [PATCH v9 3/3] printk: fix double printing with earlycon Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-05-11 13:40 +0200
        Re: [PATCH v9 3/3] printk: fix double printing with earlycon Aleksey Makarov <aleksey.makarov@linaro.org> - 2017-05-11 23:20 +0200
          Re: [PATCH v9 3/3] printk: fix double printing with earlycon Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-05-12 03:20 +0200
      Re: [PATCH v9 3/3] printk: fix double printing with earlycon Aleksey Makarov <aleksey.makarov@linaro.org> - 2017-05-11 23:20 +0200
      Re: [PATCH v9 3/3] printk: fix double printing with earlycon Petr Mladek <pmladek@suse.com> - 2017-05-12 15:00 +0200
        Re: [PATCH v9 3/3] printk: fix double printing with earlycon Petr Mladek <pmladek@suse.com> - 2017-05-12 15:50 +0200
          Re: [PATCH v9 3/3] printk: fix double printing with earlycon Aleksey Makarov <aleksey.makarov@linaro.org> - 2017-05-14 23:10 +0200
        Re: [PATCH v9 3/3] printk: fix double printing with earlycon Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2017-05-13 13:50 +0200
        Re: [PATCH v9 3/3] printk: fix double printing with earlycon Aleksey Makarov <aleksey.makarov@linaro.org> - 2017-05-14 22:40 +0200
          Re: [PATCH v9 3/3] printk: fix double printing with earlycon Petr Mladek <pmladek@suse.com> - 2017-05-18 17:50 +0200

csiph-web