From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753345AbbJUONo (ORCPT ); Wed, 21 Oct 2015 10:13:44 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:57151 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbbJUONm (ORCPT ); Wed, 21 Oct 2015 10:13:42 -0400 From: Arnd Bergmann To: Peter Hurley Cc: Masahiro Yamada , Linux Kernel Mailing List , Stefan Agner , linux-serial@vger.kernel.org, linux-arm-kernel Subject: Re: console vs earlycon ? Date: Wed, 21 Oct 2015 16:13:08 +0200 Message-ID: <4963882.HSXu6hF7zO@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <562798EB.7060202@hurleysoftware.com> References: <5490682.zH2vAEO2id@wuerfel> <562798EB.7060202@hurleysoftware.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:D8iH6SmOoZnL2PiUutXpFm6ZQBadrJ+77Rln9wPxkV1EVG6/oMs 39wXWTha1ggSndtnwqCPx//tC33UA7IdAm1kSpkasBhZrG7lpiOfx5ForgOLibUzQp/hAg+ yhTTih9HZHAO/GD2r+ovt7vkWZ4QeINvHBNcu/HMpC01mA5xyjab1InCU6OalI0zVuESIB/ 1w3VI/ilEp+ebMDxbVDrg== X-UI-Out-Filterresults: notjunk:1;V01:K0:znltP2pzNzw=:y27x8OLreQfWBy6Uwm0QB8 Y9dxIaGxSYQ0KO6ykZm84KFgji/ajFXr4ldfC6MFpV9U9miVUQWbk3Mpix3T8+1pzYbwA0biT VNePRiqZpK6W7ZPjM9irOQU58Q6eDgGyj7m+PwMYTSsDfju/h2BA1BPU220lEmDjKnVqPOLp6 VE8oW3mvKAUnRxR5uPQAfdJHXSG6PQdg+YbA/q61hNKlPAWBdcqNRvmCxwLcF9sDg1yHXH/w2 s4wa+jl/ySkuq94WVSY9LbwSS2S7bl2KLEOqt8JprKDKesHMg7QPIIyCJdGb54z+YfzwMGJnc lnA94jK6D6SG9LifIgs0tugf5r9nG84MQQeAdfRnoTzyZpxH2TGqfVFz4XR7QppD+LRnAdQQ8 CGRARKz9CW44Bg5biX7E2XIhDE11/m/ty6Iq3erGWVEQub1G/6r9fC/m6Fwuja9oVGhmcadZ9 iqUjD3TXmYtnPLAz69cKCm1CBg1GcpQL8DERwihyZN3EmIlUnVO0mon5kpdGl15QJFdKgYGl6 nzlOKPouzvzkYhhc7teok8hosvKy2Ufx1eQJti7tu8Stfu7tvOo5fk0/p5OSxA7tcVS4nb69m bQjWfDmiDotWgs8xF07NpyC5iaHW2EJMEWE0ZsfJGSwJ2zX/EY/pRZ5LXpDcX8IL9K1RvoH5B +XBIVzT/c2YAlSCNyA9N6DKBsHExhqNaqI8nYdSSWf235uB3IFZ7HtYOECfFAILkA4tcXmtIH JwKXxCDGHRWaa1A+ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 21 October 2015 09:53:47 Peter Hurley wrote: > On 10/21/2015 06:36 AM, Arnd Bergmann wrote: > > On Wednesday 21 October 2015 18:30:05 Masahiro Yamada wrote: > >>> > >>>> I am trying to implement OF_EARLYCON_DECLARE() for that. > >>>> > >>>> I was just wondering if console_initcall() should work as well. > >>>> > >>>> > >>>> As I said, I noticed the console_initcall() in 8250_core.c > >>>> only works on very limited platforms. > >>> > >>> It works with all those that use of_serial.c, right? > >> > >> I doubt it. > >> > >> > >> I have a board with a pure 8250-compat device working. > >> ( compatible = "ns16550a") > >> It uses of_serial.c, of course. > >> > >> > >> As far as I tested, it would never enable the console at console_init(). > > > > Ok, that sounds like a bug. Peter and others have changed that code > > a lot in the last year. I wonder if this has never worked then or > > if it has regressed. > > No, not a bug. console_init() is only for legacy platforms, not for > probed drivers. Ah, I had no idea we were moving in this direction. So I guess the idea is not to add another for_each_compatible_node() loop when we already have two places (earlycon and tty) in the code that do this? > > * arch/powerpc/kernel/legacy_serial.c does everything we need, but > > does not live in architecture independent code and does a few > > things that we probably don't need or want there. It relies > > on scanning the device tree for known UART device nodes before > > the platform devices are added. > > > > * for console_initcall() to do the right thing, we want both the > > ttyS devices to get added early for console=ttyS1 to work, as well > > as having the preferred console work based on the stdout-property. > > > > * we parse the /chosen/stdout-path property in drivers/of/base and > > store the device node pointer in the global 'of_stdout' variable, > > but do not use it until the uart is added by the tty driver > > and calls of_console_check() to add the default console device. > > I'm assuming the issue with trying to get console_init() working > is because the dummy color console causes the earlycon to be disabled? I don't think so. My line of thinking was more about usability: earlycon requires that you edit the kernel command line at the moment, while console_init() doesn't require any user interaction and just uses the stdout-path. I guess we could enable earlycon using a Kconfig symbol if we want to, or make it a per-architecture decision whether it's enabled even in the absence of the command line flag. Arnd