From patchwork Mon Oct 24 11:26:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9239 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp461134wru; Mon, 24 Oct 2022 06:43:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5qm5HoqUNNx7nayrrNcs/eJrxYNE9ELJk0IiC2pOmDLPv4X1+wp/3aYIPud9GBTdGY4dcF X-Received: by 2002:a17:907:1dec:b0:7aa:6262:f23f with SMTP id og44-20020a1709071dec00b007aa6262f23fmr1971081ejc.38.1666618993125; Mon, 24 Oct 2022 06:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618993; cv=none; d=google.com; s=arc-20160816; b=A0ljrkiMGuJB00HEcpiTb3uIQB/Zvcw91Gg9HZBhnr4ku69BtMwYzNHlrfOvI4e1VI hsT4/+NjyIENW8SP0NVkRCklV/qf410c5n79aNyUs6CfMSQ8mjFvs5Tzj8wx7/5HAfMt HE1sPUcwcuMvmjgn8ouMDt3yZ4HTwDYYujBZKHNmvLbUXSNa5j8JrqAPZX8hsKJ9QfFJ yCdk/MsK4Vz1Ohc13pBL/PZp8ZSDHsU2sDJ9ZQWXhAnHOcg9YbRB6ahqoDNxpudQXYNZ GMrhUCasXorkRGxQuQb0WXbCT1D2NXEk0fzDSx/jGzCrmuROxaeA1LxahwZxZN8V7YE0 udgg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gfiM7D4DY/CXosxoenaCihyzFsCBWi2pqj6omZWso30=; b=I4PC2G0hxEtN7KyQNkgpyoaMH8sxK5pzvbAxn2geNBhhOb+GvL+P/EduzxbB5UyP1k 9MuGN2HUdbx9w/mOluWjdF3fHtE4XSFDBmMJ/oz2ZAqofQPj3Ch0YWmbfAHnwvGgSCi6 sQeR7BbCUj5cpXfmP1VHAjDZ8AZIpDZRddNocBbyBvQlnRBrsaQKi0o0he9C7Cvk+kvL 70wLyqS0HjiNW+6bxAgEj6mDGWQtlHMvyEjByIHmtw4PCtsRV07Ynyi8aVuHpip3nNcN lwQHp2d6ugSpm+gKAnuuir2aKB09cDkt2EjGTcW1bvIWMd/NRD2XRC332GpoBKbUD+Ks XHew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Se/A7uG5"; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw12-20020a170906478c00b007309a570223si29660108ejc.609.2022.10.24.06.42.45; Mon, 24 Oct 2022 06:43:13 -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=@linuxfoundation.org header.s=korg header.b="Se/A7uG5"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232793AbiJXNiS (ORCPT + 99 others); Mon, 24 Oct 2022 09:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236027AbiJXNeR (ORCPT ); Mon, 24 Oct 2022 09:34:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8391240031; Mon, 24 Oct 2022 05:35:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 427D8612F4; Mon, 24 Oct 2022 12:34:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51B7AC433D6; Mon, 24 Oct 2022 12:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614893; bh=QP6jpKbzjIw/sS90nlAhLMRpCZpRodo2sINVhMurHAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Se/A7uG5u+ZqmbV0V7HmNy5o6t0KlKrjW5/2T/KKIG4z2V22ADJj17MbRwP01iYQl GvgcyNGHZkU5FRvjdzTy+ZEivJm7p6iAQsTZHHW9Q5zs24xw4jX75kVjA8i41vA24R yuFF6VJah0uftkpXsMvSvwOBhBjawsNzJ9vVlu8o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wenting Zhang , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Conor Dooley , Palmer Dabbelt Subject: [PATCH 5.15 044/530] riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb Date: Mon, 24 Oct 2022 13:26:28 +0200 Message-Id: <20221024113047.011089891@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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?1747576676979404756?= X-GMAIL-MSGID: =?utf-8?q?1747576676979404756?= From: Wenting Zhang commit 10f6913c548b32ecb73801a16b120e761c6957ea upstream. When CONFIG_CMDLINE_FORCE is enabled, cmdline provided by CONFIG_CMDLINE are always used. This allows CONFIG_CMDLINE to be used regardless of the result of device tree scanning. This especially fixes the case where a device tree without the chosen node is supplied to the kernel. In such cases, early_init_dt_scan would return true. But inside early_init_dt_scan_chosen, the cmdline won't be updated as there is no chosen node in the device tree. As a result, CONFIG_CMDLINE is not copied into boot_command_line even if CONFIG_CMDLINE_FORCE is enabled. This commit allows properly update boot_command_line in this situation. Fixes: 8fd6e05c7463 ("arch: riscv: support kernel command line forcing when no DTB passed") Signed-off-by: Wenting Zhang Reviewed-by: Björn Töpel Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/PSBPR04MB399135DFC54928AB958D0638B1829@PSBPR04MB3991.apcprd04.prod.outlook.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt Signed-off-by: Greg Kroah-Hartman --- arch/riscv/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -260,10 +260,10 @@ static void __init parse_dtb(void) pr_info("Machine model: %s\n", name); dump_stack_set_arch_desc("%s (DT)", name); } - return; + } else { + pr_err("No DTB passed to the kernel\n"); } - pr_err("No DTB passed to the kernel\n"); #ifdef CONFIG_CMDLINE_FORCE strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); pr_info("Forcing kernel command line to: %s\n", boot_command_line);