From patchwork Sat Jul 8 01:17:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raul Rangel X-Patchwork-Id: 117350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3651363vqx; Fri, 7 Jul 2023 18:57:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlHGbH7ZI+RfyrlDZFCmhsXhPiwOyY5hqAaI7cdvTpB4wOW1rpDi23SEit0R/Q3ecIKj+f62 X-Received: by 2002:ac2:5b1e:0:b0:4fb:8bab:48b6 with SMTP id v30-20020ac25b1e000000b004fb8bab48b6mr5508193lfn.52.1688781425312; Fri, 07 Jul 2023 18:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688781425; cv=none; d=google.com; s=arc-20160816; b=LqPV8G5dbPTKyTPwJznACzK+oZZHfziGUFDVx0FkEA+QW3HhUD2OlymTvdiBnk42Il IhZuiDvlYxsrZRN/velcGPIaZa2hybUS5R+D+FGlq5BJlbAq2Ke5cy1xku3gW6IrN+ca X77xmCN9wNAk4e6VM6jv/g1EmoZhICjn1elGUw92cXtFzNT9zQ/l6JL2ABUuhYJ1FWD2 bPFg50EprmFQw7mPCimu12+ZzbNta2YwU8XQxbrT/VpOiP4hLYeae8pCoZJRsQqqFRzV HRZJ6iTp2FBlQ8s9jsZQw/ELg7CHBQzxDYmQ2/sczdgynPMRahTLtw/RGLKrVKZTrXoy 8rWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pMf2ttY6PRhnasWEBwuZ08fJpAiDwds2NhjWZz0hZDw=; fh=xgLv/1PBIaRU3bhJCksoRrluoBXMjyU1WyjNSuq6b8s=; b=cly6A8z9jhapLCEMX03BxCJtgqcxRFFtktCrzUWRKobuNsYs6By9+FM3cGTE8iu/P2 pnJfmsXWPz0oPBW0N9G4ilFrjtFt+laUa4UPYWUyrMWKiLGKK83BF9Et0rr0+GsUbKks llo1CQcmeMPT7rEJv25YVAoJXXc+BOQl3SGKs4hvHw4ywDfTbGSHsTuCbOSEet/KjDc9 Vq78hml4TwMhgSalPRK7a2VeSvSbSSRmA38cu0+++AL48e4ubuty4vtolYtgEKVS10pF MRM9qiPcwYYuLc36T8lBuWEKENgf6mkew9OWDaobEp1BJ9ysaMU7Th3Z9vQaCq0XwA5T TEsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VMs7DYqK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020aa7c74d000000b0051dd51cad0csi2731546eds.50.2023.07.07.18.56.42; Fri, 07 Jul 2023 18:57:05 -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=@chromium.org header.s=google header.b=VMs7DYqK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbjGHBTT (ORCPT + 99 others); Fri, 7 Jul 2023 21:19:19 -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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770815671677791352?= X-GMAIL-MSGID: =?utf-8?q?1770815671677791352?= 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=` 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 Signed-off-by: Raul E Rangel 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); }