Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp61960pxa; Tue, 11 Aug 2020 17:22:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn90syf/bTb+YsGMXsssY3Jvfp59ZjajzZ/N5Y/i7yyEH54itzISfchsWdF3/AjtWUZcx9 X-Received: by 2002:a50:ed84:: with SMTP id h4mr28776776edr.278.1597191729147; Tue, 11 Aug 2020 17:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597191729; cv=none; d=google.com; s=arc-20160816; b=axkBAtquqEpSbl7UqquDyadpEgRwBtmjLjfp4HnzlxwmZ8im0A/1M74WxjrRd/dxnq Tw5Zpdh484Nagx7GSuU9tvFot2+CHGLfGhXM1Qd/3UGzP79TZfI+Sq4GEA/94Ft1T5Ln /luncGkJG/owqyLVgx4v7Ke+6AazEel08c/3rxYeBxeFdD5S8ER6aBKJK/G7LwAWlsTd xYlD8RNRRnBzHjbz87sR56oycUB4V2ejkwdazhB74TPbuJCZ+Swe+z3swKAWAG9ymHO7 D3zH2kQTAOngG+lWjPzMBsQBsessPlzVqxIJYhv+OC3LvqtZL6Hy8O9w/ag14dRWNQRA LeVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OiD8JCLx67JzjWgveRnje+NFfpOX7CKvakHy/Siehxk=; b=EtYCOm2SES6CUt3lJ56zMvTAbDzG/06yXSjqEoOop0FLPOeKcg9C9CQAbdBi+UKdiL bJur2iCKyqyhNHK8DXTGmFWrM6iTcJ3wgh0nE2SX7xOpE6ClZGpr7mhDuLM0sFEvqDWW NSL/EniGqagcOuvTJs8E9mLP0VaPflkSmp8UcFVGjRb5VvE9FZVXm2djKORFX+aWV1z7 Kishl83YOphh+//Kdk8+BsbT7P2V+WqZGAsZiF7qE4N3zidnxNsjx3yPquWjm3vBZ297 qkDbWMskab79O6MVhWjXp2w6+8/kHxTPJacGsm+CA8AqUBorHBpT742m79ZFsxTdEfiL W6lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=QD3uIFRZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si123220eja.259.2020.08.11.17.21.45; Tue, 11 Aug 2020 17:22:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=QD3uIFRZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbgHLAQE (ORCPT + 99 others); Tue, 11 Aug 2020 20:16:04 -0400 Received: from crapouillou.net ([89.234.176.41]:52130 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbgHLAQD (ORCPT ); Tue, 11 Aug 2020 20:16:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597191324; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OiD8JCLx67JzjWgveRnje+NFfpOX7CKvakHy/Siehxk=; b=QD3uIFRZjTrL5TyETWf0viZmKczWuWM2zbGeoCvsH0xR5QMcqUBzZoK3Om67qUO99vV+Hj aXMacjvb1rDaG1FAPaXAQLeMoTrT4B0FBZcEZLkg3WtkWc9oTFhkcQ9txUuyumngHg+FIA BdSlXs/fw5IW/DbUTZl/xVITXYd46GM= From: Paul Cercueil To: Thomas Bogendoerfer Cc: Paul Burton , Krzysztof Kozlowski , =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0?= , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 06/13] MIPS: generic: Init command line with fw_init_cmdline() Date: Wed, 12 Aug 2020 02:15:03 +0200 Message-Id: <20200812001510.460382-7-paul@crapouillou.net> In-Reply-To: <20200812001510.460382-1-paul@crapouillou.net> References: <20200812001510.460382-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function bootcmdline_init() in arch/mips/kernel/setup.c will populate the boot_command_line string using the parameters hardcoded in the kernel, and those provided in the devicetree file. Then, it would append the content of the arcs_cmdline variable, which is filled by the board's plat_mem_setup() function. The plat_mem_setup() function for the generic MIPS board would just copy the current boot_command_line to arcs_cmdline, which is nonsense for two reasons: - the result will be appended to the boot_command_line anyway, so all it does is duplicate every single parameter on the command line; - the code did not perform at all what it's supposed to, which is to retrieve the parameters passed by the bootloader. Fix this by calling fw_init_cmdline() in plat_mem_setup(), which will properly initialize arcs_cmdline to the parameters passed by the bootloader. Signed-off-by: Paul Cercueil --- Notes: v2: New patch arch/mips/generic/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c index 805d0135a9f4..029f47ea390c 100644 --- a/arch/mips/generic/init.c +++ b/arch/mips/generic/init.c @@ -106,7 +106,7 @@ void __init plat_mem_setup(void) if (mach && mach->fixup_fdt) fdt = mach->fixup_fdt(fdt, mach_match_data); - strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); + fw_init_cmdline(); __dt_setup_arch((void *)fdt); } -- 2.28.0