Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp893831imw; Fri, 8 Jul 2022 13:53:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u1WsM+6HYwNf4epK8vwHO1CHos2pOkMM1dXt/NVBvw/ffmcKPirl4T2weZ5HDpcv3TGZD/ X-Received: by 2002:a65:6044:0:b0:3fc:674:8f5a with SMTP id a4-20020a656044000000b003fc06748f5amr4887385pgp.436.1657313636016; Fri, 08 Jul 2022 13:53:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657313636; cv=pass; d=google.com; s=arc-20160816; b=AAM4W8UQ2dT8pUgiSCIU9QJCvqKpVEK16jazvE8SVlb+uUrl70xs2AH9iJdoU3Osn6 6g/ld1dXv+1f+M8p4smcL5X6rMRLkQc/9/0jle3yF7JNEqf3ZvGR3/yRZ6DuJQ1JPoQG 5J5aKfHfYVElGTlK6gpk90Du5HIWKLNt5CLC1K/n2u+oeDDPUCUKJYjRu8h3lydfhJeD hlU4bpTjF+mL2ClaD4tDj7Y0Q615LZ2r9V2XYMWJ49E5bDFaZlH087qRUyY4aHqTmSep LUb8wi5UNJgPRO5MfoM7FI1NirADCtKnbF6pAmk/l3ebO1vghoGlEdpqgGphnZTGyPqO r0lQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=g4NhtYnQMBIxsGM0tNxNz6EJinn3yONEplQUbUiY9/k=; b=qW38+eZOJIrtVMoPZZ/4Yhcr9UC3Uw96xACoRUkiET5uUFj+rJRbk+S/OzSmLYUAYJ CPCkrRLYDnlBAXjwkzjLay/96fTlInwUFuHGBFWRit6qcgYrfalYovKFUyJq7bdfz0Se OpSJUv3sO+xR4s+r/3t1Bi87sVHVriy4ol0bV0BWdGiXLTxZS4fWES4OTyoWSIolqcDB Ccylnw8jjK1cnIsQDW5bPBdz2TiFixLW3SzKwIQ9hZR356vsb89uM8oPEkQrNtWwfLVd ti/jvkxOQwWlbu/qEDHcCOeQhCzA0c4bgMOus1D3m7pFfRz+caNk7XCOKlA8a8SX7ld5 3/aA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=O26cDcJr; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x3-20020a170902ec8300b0016bea2a24casi14180020plg.3.2022.07.08.13.53.42; Fri, 08 Jul 2022 13:53:56 -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=@outlook.com header.s=selector1 header.b=O26cDcJr; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239604AbiGHUpA (ORCPT + 99 others); Fri, 8 Jul 2022 16:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238369AbiGHUo6 (ORCPT ); Fri, 8 Jul 2022 16:44:58 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2044.outbound.protection.outlook.com [40.92.107.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 319A49CE3F for ; Fri, 8 Jul 2022 13:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AqRrK/eSwegSJr72eahjS3J2akwLFU9ifi4Wzzc6YKmD3bmaGsVRf81y5w2sdE9WRMs/gQnd6YutTz0Fiihg19f3effXGwYFLjVAd+ojoiERE3+fWbZ+oYgLDg9YNSzugx1zTX3X9pA0z9owveZXQvhSKir84Wm38t1nQvB6ese6kLhRr+nF4MEtiVrYTZ1bgCmvjxokaf6VhKa0XXcDW4AbXMwFiyMAt5XUPI3Y2qy3HVL5JXoH3iwYWDnmFVpbKldjEDZ7UPensD5/qH6bMBN5l55Lg+O+lMZhnBrm/x7oZp6dOf31rE3ZmvtAZrGDsXBlbdnmMpTMXGTUKSGVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g4NhtYnQMBIxsGM0tNxNz6EJinn3yONEplQUbUiY9/k=; b=aO9P+id8j9dIY9ZsEhkcWwp4PtlywRemXiYdd9uMRzMhif4u19kbHyK9ZZlygk2F8/nYr66Qbt1KmwXNSmaFBR2WbZ0M1Vcce520sEFDjGJ3bK+QM0C0vRmCJsWCs0ck2NipOBTZ0+Jhb3kaPEBB7nDZqeW09mmOp01uUV630ZcJdSx/qvvUitVvIbMpDcb6HwSVduiBTAY85jug+2M9GVNO64rNQJ2EQ+VYV1WP2A5g56e9MJILn3ZA0IZQmnoiQ6QoJLEWvzXGkm1gz8EN4zQRCsFyd4MQ+qgDAIk71PkpnQrWC7GLZCXSD9dYXtEHWNi3feBJlDLeDZ0Su+pvIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g4NhtYnQMBIxsGM0tNxNz6EJinn3yONEplQUbUiY9/k=; b=O26cDcJrYK6dwnygXaTCXOtFkPcY0i7clTNKJTBPJ7c2FmJMwC9zxGNIC9XV71wL0OwyORk6V614Vii3Tl2MBlvzxZLWobyl7GbvjlPbkNJ/Zsc+NBLveESsoe3/GO5RPXKdUQV/SJ2dZu7fFoTlAW5RE0F3a9G3cPV2ndhaHSCcFcConhrkFWprarWpNt7MnoQ1/6ctOudWsuFBT9JqiDi1MqC9jh4Lg2njNK+/m/XBTjwGa7O5eOT13nvf/1xEaPF3jzufMAE1H+UCSSI6Go7pZLiZ/za4B+Qe6slFoj6h9MjHd7tG7hdpcU17wFgy+3s7bvqoQqwujYU1d/jofA== Received: from PSBPR04MB3991.apcprd04.prod.outlook.com (2603:1096:301:1::9) by KL1PR0401MB5244.apcprd04.prod.outlook.com (2603:1096:820:8e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Fri, 8 Jul 2022 20:44:54 +0000 Received: from PSBPR04MB3991.apcprd04.prod.outlook.com ([fe80::21b8:a14e:260b:cade]) by PSBPR04MB3991.apcprd04.prod.outlook.com ([fe80::21b8:a14e:260b:cade%7]) with mapi id 15.20.5395.025; Fri, 8 Jul 2022 20:44:53 +0000 From: Wenting Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Wenting Zhang , Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb Date: Fri, 8 Jul 2022 16:38:22 -0400 Message-ID: X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [ZnY4+7SjfT2nAdfJ6HjQxuxd8bXRL/43] X-ClientProxiedBy: MN2PR15CA0006.namprd15.prod.outlook.com (2603:10b6:208:1b4::19) To PSBPR04MB3991.apcprd04.prod.outlook.com (2603:1096:301:1::9) X-Microsoft-Original-Message-ID: <20220708203821.1695996-1-zephray@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5f6fda3-b85f-4157-16b4-08da6122b604 X-MS-Exchange-SLBlob-MailProps: DJLbvgWm8MbzvjTTznORWVK4iZPQeQ1VU1K3mRwsVX+lgbIz9Ke9J/0SF6PfYYxjM/aTSGTW7ne37rsEEl1pLG6FJqpEvQkQdrxW9uoz8h0dz9gz1H7wSTxBFD9a6uRWZA8rGLQdE8GYvSnXG53K3Cv6jKtKQzhcdoYmOA5IwmKNqH1u8yxX0UsQA+gZQgAbBEaP79PhlTb5kBxtHg4zhmqsNT/YnXnat+U9urr5z3vom7HRHpLNucK5VERz6YFbpQpn4E2f5mJ2c493MmHM75Yc4M7X2swq++MWkDGpmi3t8pCyXckqKw0ufLNpzrbfwgN7pa5gWUFeZ6lgRHocmtemQAo/oYsnrPLQpUw0Xtty/RS3jyd96m0x7velx1QfOUlfn51AHvcOS78HLnrMNX6PWMT03B8wGrXnz6cihhzoqoGIfnP9cccv/M5ug+yPi/Phjb+5lYaroel5jaliDXXheoOFyPCCu97DvonF4tZhGGldoAdVsBEcd+yfLPX909jI/lIYGNhFopXXS2hgazpG175wnK6S3olC0JQerloctXrFHgPGL78H2z7F37rLDJLV/17xkGEOcFSw43qrf4kXowpscQ5oAkqilF4WABkewuQdsWIbA+cxUnUUri7lq0JQmWATWYYUXZM5UIoYNSJHNGvm8R/nyFaJzkOfqjFy0lWIcRgEn3s/GGbjkJwZQjqHdJjjZTE/tOkFnnDXoQ== X-MS-TrafficTypeDiagnostic: KL1PR0401MB5244:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jVsSGVvukMIXQuW40Tv38dmO7geKYi2WpRf1i4/oI2RQZT4iaV3kslHExrGDFY9TU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Y2VAvbeL5O8TA1klxkYTQ44Z3z6yB8MOOpmcwH/Xd?= =?us-ascii?Q?4HsiWjpeE+My/tXro+7saBjqt/ah3qAoZdPnrlPS/+14jAcJiqO2Q/gj6x1o?= =?us-ascii?Q?OohZnRKwTdpXeXfztK6Bf2ICJOEJRR26MVD+kSKghg=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5f6fda3-b85f-4157-16b4-08da6122b604 X-MS-Exchange-CrossTenant-AuthSource: PSBPR04MB3991.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2022 20:44:53.8880 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0401MB5244 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, 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 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 --- ChangeLog: v2: Add fixes in commit message; fix code style arch/riscv/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index f0f36a4a0e9b..061cf8db3156 100644 --- 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); -- 2.34.1