Devicetree
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: Hans de Goede <hdegoede@redhat.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: Mon, 7 Nov 2016 17:16:32 +0000	[thread overview]
Message-ID: <3421375.fR4RSn7eD9@np-p-burton> (raw)
In-Reply-To: <cf275db8-6d2b-c891-9280-f141c6f10733@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2849 bytes --]

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.

> 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.

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.

Thanks,
    Paul

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2016-11-07 17:16 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 [this message]
2016-11-08  9:12           ` Hans de Goede
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=3421375.fR4RSn7eD9@np-p-burton \
    --to=paul.burton@imgtec.com \
    --cc=akpm@linux-foundation.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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