Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34751976rwd; Sun, 9 Jul 2023 19:51:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlFnJUBqPKs892V9TUvjhmhUR/HtIum5OwUS+qqisVDJ2YAgU/h+KiQekcG/eaQqiFxCnapa X-Received: by 2002:a05:6358:6383:b0:134:d281:2cb1 with SMTP id k3-20020a056358638300b00134d2812cb1mr7197593rwh.32.1688957474121; Sun, 09 Jul 2023 19:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688957474; cv=none; d=google.com; s=arc-20160816; b=Q5zFm/nH9S8yy4b0fZmkuBrBiUMB6jARHxFFehe/TqYWNYhgDpzHaEHyxhJJKskwel Vnw7LR1I+3b8z5lbRwFrNPFCTJg079kf8VI/y5zdH2m9/hySzN1WashPbMbN3gwtRzOm ZIjPaRikVkoUn0zPNfp7KrcYYorheBzqzUgxvZOAw1Th6x3mfMNnr5u+BEymyyr66Ke8 E9anWZk/ywQatBI6TMXer91HXXQY3k/3wpVM19+Mwig4UDw08/33U1Iw1uP2hN8/4S+a 6dXBSTeqmhfUaZI2xbHOOdFE7awS97Rimw0TgB0jY8/c8ZcVyuwXyHW9M+jJRRAQiMsA S2vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+y4XEn+h2SjQXL+RkuvynfQ4Ve1Ob5waT685KLO1HY0=; fh=fnCqIMtE5WOtb3niPmWiTqiQsHKR+89eeAJFNsmSr0c=; b=P1h6RZ1H+7Ia5AIXIc+QO1CTjjjjlrUIafo6hAiW4RAhhQ+CKwnGBecOXx5J2E4qUo 34I8gpQ2ATRzvRa3mu6QYVjI3tK9sHWBRz0hoFIi+hrgPkR19ECBMBfWU9wAf85bBIYu Q66112BEq4D7gTG/NuH2BcdDxokPRAD6C2lqPgHnFyje8bUJ/JvnyoCIXS0O+TULElTV mU/8eWUTEY7Ni/lRsqd3YJT3v2TF7ieuwO9W+WG9XgqJrfkamoRaimthwo0TPBTsOfWl 8zKhwSa3uVnM0S12LeHl8X+j2yQTQ5txIFVqmuO7xzSzZ43XDWFLkpgoiLaRrbnjxMcQ SXJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=giL5ajlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a632a0b000000b005533db5fbb0si8183177pgq.379.2023.07.09.19.51.02; Sun, 09 Jul 2023 19:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=giL5ajlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbjGJCnq (ORCPT + 99 others); Sun, 9 Jul 2023 22:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjGJCnp (ORCPT ); Sun, 9 Jul 2023 22:43:45 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FE27E6 for ; Sun, 9 Jul 2023 19:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=+y4XEn+h2SjQXL+RkuvynfQ4Ve1Ob5waT685KLO1HY0=; b=giL5ajlcUO6U1KktX7U0UPyEzN Fuk7+S5S1ZRTSxlrTgI4fB68QnwcdRkLTK6ddyC8z44x29ebVaq9WRbkyLnPdIpK/UQApKOTzNlNx cIdTQ9R9AMC/9iqXeZCbsNJ9avsY/V51ut70kwWT7NiGwSiQNb85ViT0QDpq+xQ/YAsw4t8azvAXt MS3BkGfI7IqyLTUowg0GlvAAPdgE4W1sDoIemlEMVhrhqOmv+nEiHX4I5zArsLgnb0Z6wqMtFzEgx MB5OI9giflw6HGvBm7B9jzo8xCKS2mHcPdfzHlq7joAocNKC36h7WXMMVkM+tRzWmFJYSusO8WdIc xddCN7QQ==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qIgsF-00ACxj-0i; Mon, 10 Jul 2023 02:43:39 +0000 Message-ID: <3de1ff24-3970-6e22-a73c-70446b8de4bd@infradead.org> Date: Sun, 9 Jul 2023 19:43:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] init: Don't proxy console= to earlycon Content-Language: en-US To: Mario Limonciello , Raul E Rangel , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Petr Mladek Cc: kramasub@chromium.org, Alexander Potapenko , Andrew Morton , Ard Biesheuvel , "Jason A. Donenfeld" , Li Zhe , "Liam R. Howlett" , Mark Rutland , Will Deacon , Wolfram Sang , Zhou jie References: <20230707191721.1.Id08823b2f848237ae90ce5c5fa7e027e97c33ad3@changeid> <6101a3bb-30eb-97fc-3a8e-6d15afc4efb5@amd.com> From: Randy Dunlap In-Reply-To: <6101a3bb-30eb-97fc-3a8e-6d15afc4efb5@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/9/23 18:15, Mario Limonciello wrote: > On 7/9/23 18:46, Randy Dunlap wrote: >> >> >> On 7/7/23 18:17, Raul E Rangel wrote: >>> Right now we are proxying the `console=XXX` command line args to the >>> param_setup_earlycon. This is done because the following are >>> equivalent: >>> >>>      console=uart[8250],mmio,[,options] >>>      earlycon=uart[8250],mmio,[,options] >>> >>> In addition, when `earlycon=` or just `earlycon` is specified on the >>> command line, we look at the SPCR table or the DT to extract the device >>> options. >>> >>> When `console=` is specified on the command line, it's intention is to >>> disable the console. Right now since we are proxying the `console=` >> >> How do you figure this (its intention is to disable the console)? > > I read that as "it's intention is to disable the default console (tty0)". Yes, that "default" word should be there IMO. Does this patch affect behavior if someone uses console=tty0 i.e., the default? > > IE if I add console=ttyS0,115200,n8 to my kernel command line then I don't get the output on tty0 anymore.  If I want it on both then I do > > console=ttyS0,115200,n8 console=tty0. > >> >>> flag to the earlycon handler, we enable the earlycon_acpi_spcr_enable >>> variable when an SPCR table is present. This means that we >>> inadvertently enable the earlycon. >>> >>> This change makes it so we only proxy the console= command if it's >>> value is not empty. This way we can correctly handle both cases. >>> >>> Signed-off-by: Raul E Rangel >>> --- >>> >>>   init/main.c | 3 +-- >>>   1 file changed, 1 insertion(+), 2 deletions(-) >>> >>> diff --git a/init/main.c b/init/main.c >>> index aa21add5f7c54..f72bf644910c1 100644 >>> --- a/init/main.c >>> +++ b/init/main.c >>> @@ -738,8 +738,7 @@ static int __init do_early_param(char *param, char *val, >>>       for (p = __setup_start; p < __setup_end; p++) { >>>           if ((p->early && parameq(param, p->str)) || >>>               (strcmp(param, "console") == 0 && >>> -             strcmp(p->str, "earlycon") == 0) >>> -        ) { >>> +             strcmp(p->str, "earlycon") == 0 && val && val[0])) { >>>               if (p->setup_func(val) != 0) >>>                   pr_warn("Malformed early option '%s'\n", param); >>>           } >> > -- ~Randy