From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932674AbcHIV5c (ORCPT ); Tue, 9 Aug 2016 17:57:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40124 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932619AbcHIV51 (ORCPT ); Tue, 9 Aug 2016 17:57:27 -0400 Date: Tue, 9 Aug 2016 14:57:26 -0700 From: Andrew Morton To: Paul Burton Cc: , Ralf Baechle , Tejun Heo , Sergey Senozhatsky , Jiri Slaby , Daniel Vetter , Ivan Delalande , Thierry Reding , Borislav Petkov , Jan Kara , Petr Mladek , , Joe Perches , Greg Kroah-Hartman , , Rob Herring , Frank Rowand Subject: Re: [PATCH v2] console: Don't prefer first registered if DT specifies stdout-path Message-Id: <20160809145726.1f9f5e5752c94b3113d77674@linux-foundation.org> In-Reply-To: <20160809151937.26118-1-paul.burton@imgtec.com> References: <20160809125010.14150-1-paul.burton@imgtec.com> <20160809151937.26118-1-paul.burton@imgtec.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Aug 2016 16:19:37 +0100 Paul Burton wrote: > If a device tree specifies a preferred device for kernel console output > via the stdout-path or linux,stdout-path chosen node properties or the > stdout alias then the kernel ought to honor it & output the kernel > console to that device. As it stands, this isn't the case. Whilst we > parse the stdout-path properties & set an of_stdout variable from > of_alias_scan(), and use that from of_console_check() to determine > whether to add a console device as a preferred console whilst > registering it, we also prefer the first registered console if no other > has been selected at the time of its registration. > > This means that if a console other than the one the device tree selects > via stdout-path is registered first, we will switch to using it & when > the stdout-path console is later registered the call to > add_preferred_console() via of_console_check() is too late to do > anything useful. In practice this seems to mean that we switch to the > dummy console device fairly early & see no further console output: > > Console: colour dummy device 80x25 > console [tty0] enabled > bootconsole [ns16550a0] disabled > > Fix this by not automatically preferring the first registered console if > one is specified by the device tree. This allows consoles to be > registered but not enabled, and once the driver for the console selected > by stdout-path calls of_console_check() the driver will be added to the > list of preferred consoles before any other console has been enabled. > When that console is then registered via register_console() it will be > enabled as expected. Looks reasonable. Could you please do `grep -r stdout-path Documentation' and check that everything therein is complete, accurate and necessary?