From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 768A3C433DF for ; Mon, 25 May 2020 13:04:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49E342073B for ; Mon, 25 May 2020 13:04:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L8HpdulU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="0F+v1zqI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49E342073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cs6Vlc+yY8VwxaimCj/MbmPpj5hpXQxQBSAbqUKZgOw=; b=L8HpdulUSm7dQ4 BKEywj5DqpJLrM/BMRAwwl4WDrTrHlELybQ8xK7P/JDXysHG4Frz75V8bfyMceZKz+nP37KU2yIod yhaH71yVr/7QmZzpCc6hIxlLT/wFzcNEWiWsTvlNALc5aZD4ab/UA6QRlnjFDI/erv0XXmv22Iv/Y JAmomTb6nsWSKhpVG0gMtRQgo1fpM1of8MVpiv7TNokjx4xsWdzFgVNejFbdUxKCADivITksB2Tw0 EKx1U/XXFXwQ17PeQsiogmTAGJJE79QqMbth1novRqMGj8tDe0gkIHqTyVjFL9A/LoWkC23OYCVsk 7i959AW7k/006pv48CaA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdCmN-0008QR-06; Mon, 25 May 2020 13:04:31 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdCmL-0008QK-82 for linux-arm-kernel@bombadil.infradead.org; Mon, 25 May 2020 13:04:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Ol885/IH+ZlMc5ShSMqA/ZwJ2Iaqx8W4W16Kf6nI/T8=; b=0F+v1zqIjHb+MIf3lCk9th0TPP GiS5F4tI0gcFaLicwYMGEFbkiSHyw6Uao2djXhsf0YBsPhnVH3/Re0IO3H5tvczCtcjUAoJjVjSoS cKDJk+j6Nqj/nQ3wmA4qHAHQQ46GOgXXR2W+GU1zUqKqhBRlffl20VxQSdog5HRt/pSBPFTROvzOa 7cuGvrTdyAW1XRXpuaqQm0aNqkIcu/H81oXRJGeWkRxXc/p3VyzqdJ2P5Z8xtPwfqkfGSHS7xMQN/ kXIqwY4MfuGXdZoMNcGQiTsNQSReE2HTkKG7OL4Era3JKZMhTpAIf0ImWbDxYxxGUUlzQaZHwy30G izQr+tgA==; Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdCmI-0007Un-N9 for linux-arm-kernel@lists.infradead.org; Mon, 25 May 2020 13:04:27 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9CA91B03C; Mon, 25 May 2020 13:04:24 +0000 (UTC) Date: Mon, 25 May 2020 15:04:19 +0200 From: Petr Mladek To: Alper Nebi Yasak Subject: Re: [RFC PATCH v2 0/3] Prefer working VT console over SPCR and device-tree chosen stdout-path Message-ID: <20200525130417.GN3464@linux-b0ei> References: <20200430161438.17640-1-alpernebiyasak@gmail.com> <20200513143755.GM17734@linux-b0ei> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tang , Benjamin Herrenschmidt , Eric Biggers , Greg Kroah-Hartman , Nicolas Pitre , linux-kernel@vger.kernel.org, Steven Rostedt , Daniel Vetter , Sergey Senozhatsky , Arvind Sankar , Grzegorz Halat , linux-serial@vger.kernel.org, Jiri Slaby , Lukas Wunner , Andrew Morton , Andy Shevchenko , Sam Ravnborg , "David S. Miller" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri 2020-05-15 22:27:02, Alper Nebi Yasak wrote: > On 13/05/2020 17:37, Petr Mladek wrote: > > On Thu 2020-04-30 19:14:34, Alper Nebi Yasak wrote: > I think things run roughly in the following order (from what I can > decipher from kernel messages) and I think it matches your explanations: > > | ACPI SPCR | dt chosen stdout-path | > +=================================+=================================+ > | acpi_parse_spcr() | | > | -> add_preferred_console(uart0) | | > | (if not on x86) | | > +---------------------------------+---------------------------------+ > | console_setup() | > | -> add_preferred_console(tty0) | > | (if console=tty0) | > +---------------------------------+---------------------------------+ > | register_console(vt) | > +---------------------------------+---------------------------------+ > | | of_console_check() | > | | -> add_preferred_console(uart2) | > | | (if no console arg) | > +---------------------------------+---------------------------------+ > | register_console(serial) | > +---------------------------------+---------------------------------+ I was first a bit confused by the above table. The order looks fine but I was not sure about the indentation. I think that some more details are needed to get the picture and context. I see the following order in start_kernel(): 1. Add spcr consoles: by acpi_parse_spcr() called from setup_arch(). 2. Add and register early consoles: by parse_early_param() 3. Add normal consoles from command line: by parse_args() 4. Register tty console: by vty_init() called via long chain from fs_initcall(chr_dev_init). It seems to be init call in 5th round, see include/linux/init.h 5. Register other (serial) consoles are most likely registered from device_initcall() in 6th round, see include/linux/init.h. The consoles defined by the device tree are not added directly. Instead, the probe() callbacks checks whether such console is selected in device tree by of_console_check() called from uart_add_one_port(). > > My suggestion is: > > > > + Fix SPCR setting or device tree of your device when the defaults > > are not as expected. > > Maybe I can get QEMU's SPCR use conditional on the existence a > framebuffer, and get distributions to remove stdout-path from certain > device-trees; but that would disable the serial console completely > (instead of having it enabled where tty0 is still preferred). I am afraid that this is a problem with many defaults. They might be good enough for many people but others would want something else. It might be acceptable to add consoles. But it might be a problem to remove consoles or change the currently preferred one. The only exception would be when most people are annoyed with the current default. But this need to be discussed with people familiar with the given architecture or device. > > + Use command line to force your value when the defaults are not > > as expected and you could not change them. > > This works; but I'd have to know the machine's serial configuration in > advance to put it in the cmdline as "console= console=tty0", or > lose the serial console as in the above. (A "console=dt" like that > "console=spcr" patch you linked to would be useful here if it existed.) The generic parameters: console=tty, console=serial, console=dt, console=spcr looks fine to me. IMHO, the only problem might be when a particular serial console drive is not able to guess reasonable defaults for the baud rate, etc. Best Regards, Petr _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel