From patchwork Sat Oct 22 07:18:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7182 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1088908wrr; Sat, 22 Oct 2022 00:41:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4H12lctG75mZjWDZxziNPI0EuqniULMs7J0zz5ZQt/4oWewGrzOHS2d1BR2jarqbdL7HQJ X-Received: by 2002:a17:903:1c2:b0:185:47ce:f4d2 with SMTP id e2-20020a17090301c200b0018547cef4d2mr23408324plh.101.1666424494868; Sat, 22 Oct 2022 00:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424494; cv=none; d=google.com; s=arc-20160816; b=YDSp8BlvWcEI2TgcyTiXGbtrwWeG6/OfEd1yGcrtopkj/bP9dnLMAhrUgCBVZbW4iF XcWr+b0ZQCZ8OebHkJHH9VG1ir63hWkCY4ecZUNrgbp3oM7UbEM5lTgIzEqEWTkd4g+6 5wzOac1ZMvTHtvlwdHljG8kdJgRO+wZQeXhM7sJQ4CHBlW50BMda+FzGGGH6M9AEpY6v vL1VGdHBn59yaN8g1mXKq1HtT92Ns8BsjnGthj9XrosRF28WzSz5wwnirinRxcrB9IIB CYYpO2M1qJZ5z1nacBJbYKF0ISC3veUq2jnVd3BjC1GwCM5TTtBrohKqbFNVs28HZYYV p64A== 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=1B/RCUtdnLtq9BK/uSdcBIvb3CWzHFA8ivSCAj+zrLE=; b=qr00TyaquJeWdv+3CY/bdIBTetzgHrCZszYilWmx0u6zSGlfpWFPLQTNrWmJt9Nd2X nwjCt3FG/eL9IYZ6C0HnOnBFXwLg18ZKJsl62Se6i6z1H9vEmFWHab3QylO2eso17rz1 RB6TUIIza51449bJo1cwIIWqY+i/niOmX1lm57HZumxBhph4N9MvU2BZ2LpTttJcyfHt E63ymU8SWZzn0QCl0S/lBNHZ+0QpPtM5JzQqc4Tk3sA9ns7ET7pyvP0EzXmZ/iXfKv0L dYXc5BYoNhYj38OJAVgN/LoPWvG+Y79RfZZmlWgcVHJkYk3EWXGVxUTQqXAt7tY/Shwp e+gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ejrK+hhJ; 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 o5-20020a1709026b0500b00184c33ddeb8si25173273plk.23.2022.10.22.00.41.22; Sat, 22 Oct 2022 00:41:34 -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=ejrK+hhJ; 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 S230507AbiJVHlB (ORCPT + 99 others); Sat, 22 Oct 2022 03:41:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbiJVHju (ORCPT ); Sat, 22 Oct 2022 03:39:50 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97B2A625DA; Sat, 22 Oct 2022 00:37:15 -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 sin.source.kernel.org (Postfix) with ESMTPS id 15454CE2C98; Sat, 22 Oct 2022 07:36:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F35DBC433D6; Sat, 22 Oct 2022 07:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424198; bh=XxnKI/qxyl90OHgJdQ5j3WiCFtPd7fI3vYFta5Y9THo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ejrK+hhJd1eqzCVgPIDmD1qMFicOcd9SXZHBDtMSfbKstPIIa4S8r/QGrqJVlG7V3 8jEezXCJ9uTWcy+rCRQgvYL2o4DfLjH5bcFPnUn9AaDoUheEvE18eQAy9Lz/wiML1A QXg8u3DkDGXyac5ZxRn3duQ0ZP6VMf7rH9TWtM0M= 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.19 058/717] riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb Date: Sat, 22 Oct 2022 09:18:57 +0200 Message-Id: <20221022072425.331618486@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747372731127055366?= X-GMAIL-MSGID: =?utf-8?q?1747372731127055366?= 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 @@ -251,10 +251,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);