Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34652014rwd; Sun, 9 Jul 2023 17:25:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlFQ12Q/Gf9wzJogLV5BADO/EaFSrkfsjHUE7w/HXjf6hpXed8fl54JklgYwoQOpa9RDq4Qd X-Received: by 2002:a81:a091:0:b0:57a:89b1:2c73 with SMTP id x139-20020a81a091000000b0057a89b12c73mr729593ywg.5.1688948703238; Sun, 09 Jul 2023 17:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688948703; cv=none; d=google.com; s=arc-20160816; b=p32ME5YAcC/mgBOdMXeFa/3bJzJZVXMHuAH8kOUsWWm52+4DDlY9zJeCBbV/F9jVDK /HugYukobfHLbZDIV+9SV4Ah/RqiyWuutpz1lXP29Nh+W3h6q//q1HIFNq27/Ay8i5iW m0ZgavHibY+GrBSiN0y9d+XG2yEZPDr/Tt17a3VGY4vx0OYEJ2kGohAcSFmf7n7ojlRJ tV4FgidOOYh2T1JvzkpijQl11lEbA6KSbGRWFt2zYrJ0Zg6n99gc1GkUQ1DHBf//eGh2 IVtkfFUjP2RfwlfWMfLknyHad9ePpe1ZTKzlTDu7kkxf2qmOWH1IZNmyndf7M0ePs8F4 Vgeg== 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=U4MfIrzJS8GjdX26B+pip67X45wUubmm5v3gJX/2N8M=; fh=DdWAGPLGmclKfcp80WCEYvNkCdYU8YnZcNeHB9iom8o=; b=Rj5tAzN3lbxDkdV8pFLu1ZEk24tWGheoMyBtbxvTv09joyULx1R72NjuIzIzKAaEXu J1LTb8OByAyDIuF6ZRMlhSsk98vla/S44xaN9A4cCXwh7SUCIk+V9oyB8nAXl+hSDnGE PIvxboEghI57QjQwCCJ8NgcCQk0Gu0VmnfiyY98RUaOx57c4y02xYhtHIC3YxaFzCaLE 7+ph0a2fGQwhj2Bk1SvYa7UdmSoJLqtCeqJLxlzQf8JxvT4XcDsACRssA94/MzYMeuzy FQG6Gk12b/Yp94Wahu4kT0U0sCEEACSSpVCA7ixMdiXCprsNgavNlsxajQAvp7kWU1PG cdyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=2LTAI9eM; 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 u12-20020a17090282cc00b001b6ba4c90desi7614823plz.368.2023.07.09.17.24.38; Sun, 09 Jul 2023 17:25:03 -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=2LTAI9eM; 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 S229603AbjGIXqT (ORCPT + 99 others); Sun, 9 Jul 2023 19:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjGIXqR (ORCPT ); Sun, 9 Jul 2023 19:46:17 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E4210C for ; Sun, 9 Jul 2023 16:46:14 -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=U4MfIrzJS8GjdX26B+pip67X45wUubmm5v3gJX/2N8M=; b=2LTAI9eMDFwd+iXa4PCbCOG7Kj CbUC9flkUQ788kF0WLahq1pCV/jGg+I/Tyf79keDgTgEjLp7nsWW2HDuPgCUGhSZMFaQ6N8tpNm7+ RC05iWIG6WrSzFkA14hfeUwt28IQhV8OQQaWYHSRJgJ/yaPURpRNQ1iAl7OsX86f8hQfSx1gETGU7 tFxdmvHC+2bcgq652593YWkNCx9r2czLAamM7IRE9gC2/joG60fP7VvPp979/GDA+baddSDaqeM+3 SEi5EO5UabUBFA1aoDm28RctE7PemuLr6itBG9UOCabpnGafSeV7nR8ACu0kHnI3A26ejLLl5TjSP zA7gAxAw==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qIe6R-009uOf-33; Sun, 09 Jul 2023 23:46:09 +0000 Message-ID: Date: Sun, 9 Jul 2023 16:46:06 -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: Raul E Rangel , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Petr Mladek Cc: mario.limonciello@amd.com, 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> From: Randy Dunlap In-Reply-To: <20230707191721.1.Id08823b2f848237ae90ce5c5fa7e027e97c33ad3@changeid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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/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)? > 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