From nobody Mon Feb 9 14:00:56 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94BB3EB64D9 for ; Sat, 8 Jul 2023 01:24:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjGHBTU (ORCPT ); Fri, 7 Jul 2023 21:19:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjGHBTS (ORCPT ); Fri, 7 Jul 2023 21:19:18 -0400 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 056C82123 for ; Fri, 7 Jul 2023 18:19:17 -0700 (PDT) Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6b2f0a140b7so2155631a34.3 for ; Fri, 07 Jul 2023 18:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1688779156; x=1691371156; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pMf2ttY6PRhnasWEBwuZ08fJpAiDwds2NhjWZz0hZDw=; b=VMs7DYqKojHWgdK9TvcNIKSkf/E3g9IclSwld5/+ANWhlIjqwQzY+Y9DLAdQbpi8ez UMoe9exDemLi63bFv/V9fd3YjqrRCv+EiZ6Yi/hIexM0Rr4INCKkzqyXo8gmoNtnmbf6 5MW37M+Mq7/x+NxLL+LtEyz4+pbxOmQ51keXg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688779156; x=1691371156; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pMf2ttY6PRhnasWEBwuZ08fJpAiDwds2NhjWZz0hZDw=; b=SEYz+bhFVEpH5nqZGYamDeMdnflpqQRiWFv1NhKBmrRfS0vt6NeHTQDqDQINNAktVb shh9ozaIOA0Fc3OitWmE4dxwfNUwOlwi/eMJpqtqZMFe4ksom2YISHCttxu9Q/tEgK3u KctgSZ08kznYnZbKwPxfTOtfv4zth5XW6xVqPn4HUpRUaxtY6YdMnLLdU8WELgcrwN8w nhEzXujpi7PDthl6gp79VTbtZlNKx0zGJvqltCXdO2umwsYVGx7fLmtCmYA7VeL/Y4aO lU/W+gHq3/ToWoO04Bj8GiXhwaHDWKdywMct66PxFFGvaz+0isWOqTu9aFqSXhlTfAau 48dQ== X-Gm-Message-State: ABy/qLZ0Z7RlHuGiSyLn8BnVMINBCbPw9qJwthnmECAIq8Kh2vv5uU+p 38sY8tbdI/WxJDNAJ1MxT+JLLAY6O8WHHuQ00aQ= X-Google-Smtp-Source: APBJJlEO/z8kw20FTdp4B5Ds+WqJA4+yUAwNJ80NBAv/B4rD/TQbA9fO2P0EeoQFLn2YjmDlr948aA== X-Received: by 2002:a9d:7617:0:b0:6b8:19d8:6925 with SMTP id k23-20020a9d7617000000b006b819d86925mr7099672otl.12.1688779155962; Fri, 07 Jul 2023 18:19:15 -0700 (PDT) Received: from rrangel920.bld.corp.google.com (h24-56-189-219.arvdco.broadband.dynamic.tds.net. [24.56.189.219]) by smtp.gmail.com with ESMTPSA id h14-20020a02c72e000000b0042af7792d7dsm1607169jao.97.2023.07.07.18.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 18:19:15 -0700 (PDT) From: Raul E Rangel To: linux-kernel@vger.kernel.org Cc: mario.limonciello@amd.com, kramasub@chromium.org, Raul E Rangel , Alexander Potapenko , Andrew Morton , Ard Biesheuvel , "Jason A. Donenfeld" , Li Zhe , "Liam R. Howlett" , Mark Rutland , Will Deacon , Wolfram Sang , Zhou jie Subject: [PATCH] init: Don't proxy console= to earlycon Date: Fri, 7 Jul 2023 19:17:25 -0600 Message-ID: <20230707191721.1.Id08823b2f848237ae90ce5c5fa7e027e97c33ad3@changeid> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Right now we are proxying the `console=3DXXX` command line args to the param_setup_earlycon. This is done because the following are equivalent: console=3Duart[8250],mmio,[,options] earlycon=3Duart[8250],mmio,[,options] In addition, when `earlycon=3D` 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=3D` is specified on the command line, it's intention is to disable the console. Right now since we are proxying the `console=3D` 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=3D 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 =3D __setup_start; p < __setup_end; p++) { if ((p->early && parameq(param, p->str)) || (strcmp(param, "console") =3D=3D 0 && - strcmp(p->str, "earlycon") =3D=3D 0) - ) { + strcmp(p->str, "earlycon") =3D=3D 0 && val && val[0])) { if (p->setup_func(val) !=3D 0) pr_warn("Malformed early option '%s'\n", param); } --=20 2.41.0.255.g8b1d071c50-goog