From: Hans de Goede <hdegoede@redhat.com>
To: Paul Burton <paul.burton@imgtec.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Thorsten Leemhuis <regressions@leemhuis.info>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [REGRESSION] "console: don't prefer first registered if DT specifies stdout-path" breaks console on video outputs of various ARM boards
Date: Tue, 8 Nov 2016 10:12:05 +0100 [thread overview]
Message-ID: <d344247f-2aa4-d5cc-1012-4fe06f831d79@redhat.com> (raw)
In-Reply-To: <3421375.fR4RSn7eD9@np-p-burton>
Hi,
On 07-11-16 18:16, Paul Burton wrote:
> Hi Hans,
>
> On Sunday, 6 November 2016 11:54:35 GMT Hans de Goede wrote:
>>> What I see in my systems, and what 05fd007e4629 ("console: don't prefer
>>> first registered if DT specifies stdout-path") addressed, is that if
>>> there are for example 2 UARTs uart0 & uart1 that are probed in that order
>>> and stdout-path indicates that we should use uart1 we wind up essentially
>>> ignoring it because>
>>> the ordering of the relevant calls goes:
>>> - of_console_check() for uart0
>>> - add_preferred_console() for uart0
>>> - register_console() for uart0
>>> - of_console_check() for uart1
>>> - add_preferred_console() for uart1
>>> - register_console() for uart1
>>>
>>> Since of_check_console() doesn't get called for uart1 until after uart0
>>> has
>>> been probed, we don't add an entry for it to the console_cmdline array
>>> until after register_console() has already decided to enable uart0
>>> because preferred_console == -1.
>>>
>>> I'm not the only one seeing this oddity either, for example see the
>>> discussion on this patch:
>>>
>>> https://patchwork.kernel.org/patch/9263753/
>>>
>>> By simply reverting my patch you restore us to a position where so far as
>>> I
>>> can see we simply do not honor stdout-path for the real kernel console.
>>
>> As said before, we do still honor it, but in your probe example we also get
>> a (second) serial console on uart0, where as you only want one on uart1.
>
> ...but don't we only support one console per type of device? That's what
> Documentation/serial-console.txt says anyway, which means having a console on
> both uart0 & uart1 does not work. I could live with having console output on
> an extra UART, but that's not what I was seeing when I wrote this patch.
Ah yes, you're probably right about that.
>> So I see a few possible solutions here:
>>
>> 1) Do a new version of your patch which changes the "&&
>> !of_specified_console" check to "&& (newcon == tty0 ||
>> !of_specified_console)", then we would still always register tty0 (as long
>> as it gets registered first, just like now) and we would not register uart0
>> in your above example, note the "newcon == tty0" check in my example is
>> pseudo-code. I would be happy to try out such a patch
>>
>> 2) Add a new dt property to enable the new behavior you seek
>>
>> I'm myself tending towards 1 as a better solution: treat tty0 special,
>> because some existing setups rely on it always being registered as a
>> console even if stdout-path is specified and otherwise always honor
>> stdout-path.
>>
>> Regards,
>>
>> Hans
>
> That does feel a little hack-ish to me though... I don't like the reliance on
> probe ordering, nor special casing tty0 in general.
Given that we've just got a "me too" reply from the ppc side of things,
it seems that in reality people have been relying on probe ordering here
for a long time now. IMHO tty0 is special, so it does make sense that it
always gets probed first (*) and it does make sense to handle it special.
*) Even though that seems to be more how things work (an implicit thing)
rather then explicit.
> In any case I don't think I have the time to unpick all this at the moment, so
> I suggest we go ahead with your revert for now & I'll revisit the system I was
> working on when I find the time.
Ok.
Regards,
Hans
next prev parent reply other threads:[~2016-11-08 9:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 12:11 [REGRESSION] "console: don't prefer first registered if DT specifies stdout-path" breaks console on video outputs of various ARM boards Hans de Goede
[not found] ` <20161104121135.4780-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-04 12:11 ` [PATCH] Revert "console: don't prefer first registered if DT specifies stdout-path" Hans de Goede
[not found] ` <20161104121135.4780-2-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-04 19:39 ` Andrew Morton
2016-11-08 0:46 ` Michael Ellerman
[not found] ` <87h97ilrx0.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>
2016-11-08 7:00 ` Greg Kroah-Hartman
2016-11-10 14:14 ` Greg Kroah-Hartman
2016-11-06 12:13 ` [REGRESSION] "console: don't prefer first registered if DT specifies stdout-path" breaks console on video outputs of various ARM boards Thorsten Leemhuis
2016-11-04 12:30 ` Paul Burton
2016-11-04 13:22 ` Hans de Goede
2016-11-05 10:40 ` Paul Burton
2016-11-06 10:54 ` Hans de Goede
2016-11-07 17:16 ` Paul Burton
2016-11-08 9:12 ` Hans de Goede [this message]
2016-11-05 11:00 ` Paul Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d344247f-2aa4-d5cc-1012-4fe06f831d79@redhat.com \
--to=hdegoede@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.burton@imgtec.com \
--cc=regressions@leemhuis.info \
--cc=robh+dt@kernel.org \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).