Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752647AbdLGTD1 (ORCPT ); Thu, 7 Dec 2017 14:03:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41846 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752320AbdLGTDX (ORCPT ); Thu, 7 Dec 2017 14:03:23 -0500 Subject: Re: [PATCH 2/2] acpi, x86: Use SPCR table for earlycon on x86 To: Timur Tabi References: <20171207172912.17868-1-prarit@redhat.com> <20171207172912.17868-3-prarit@redhat.com> Cc: ACPI Devel Maling List , Jonathan Corbet , the arch/x86 maintainers , linux-pm@vger.kernel.org, Catalin Marinas , Bhupesh Sharma , linux-doc@vger.kernel.org, Will Deacon , lkml , Ingo Molnar , "Rafael J. Wysocki" , Lv Zheng , linux-serial@vger.kernel.org, "H. Peter Anvin" , Thomas Gleixner , "linux-arm-kernel@lists.infradead.org" , Jeffrey Hugo From: Prarit Bhargava Message-ID: Date: Thu, 7 Dec 2017 14:03:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 07 Dec 2017 19:03:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1290 Lines: 33 On 12/07/2017 01:46 PM, Timur Tabi wrote: > On Thu, Dec 7, 2017 at 11:29 AM, Prarit Bhargava wrote: >> -int __init acpi_parse_spcr(bool earlycon) >> +int __init acpi_parse_spcr(bool earlycon, bool enable_console) >> { >> static char opts[ACPI_SPCR_OPTS_SIZE]; >> static char uart[ACPI_SPCR_BUF_SIZE]; >> @@ -113,7 +113,8 @@ int __init acpi_parse_spcr(bool earlycon) >> if (earlycon) >> setup_earlycon(opts); >> >> - err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); >> + if (enable_console) >> + err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); > > So if earlycon==true but enable_console==false, then you parse SPCR > and use it for the early console, but not the primary console? I'm > not sure what that gives you. > On arm64 the original SPCR code provides both early and primary consoles (as you've pointed out). IOW, if SPRC exists on arm64 a console will be initialized. That is still the case after my change. The expected behaviour on x86 is that unless someone specifies 'earlycon' or 'console=' that no console should be initialized. There are users (some IOT boxes, etc.) that do NOT want a console. The above code keeps the existing x86 behaviour. P.