Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2764109pxk; Sun, 6 Sep 2020 12:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9WJgmRV7uMZgGUvgFqQL3swhz9r+/MgcPKSOg8eUmq0wHdjBJosiLB78Czz9AzVc+w9dh X-Received: by 2002:a50:c909:: with SMTP id o9mr18524294edh.148.1599420867086; Sun, 06 Sep 2020 12:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599420867; cv=none; d=google.com; s=arc-20160816; b=F/5ntLH0gW4HSIUkOPAucDUzetF0bjuE3A3tW2mSu5Gip7HHkrLskcFMYUnWInjNLS 9ydhlt/SLEaDjD9uzbapPZDOC5YeW4E+SeplztR5A85Ex74e58hoJ1h53s2fvE2SuB3E FOkkvw1Y2fltrXHFCqZdavrVTluS2fbtFozM3CT4ll2YvkokGm8AYxMqru611dQGH/mX xNCEp1iURt8Yf/Cey8lnz9mU9YIORlIU30bL+uM2u+70Z7HEFKnZq6e+VpXyt8/GmBof Rd63uD630z42jHCUdxOsIFGabPeV6pfYBmtqVexJrOT5Pne4hZG1n6I0+MZJ/pL6U8qg LIsw== 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=y2/qoY5aq9uuajDol9rdVEk/7JkYe+8OE3f4k4iL/AA=; b=CsWdHAwb3Qwcx+n3IjVPHB//aWbaH19zvU2w+iQmawqeGLfpbsXU2aGorM+pL38svS 3PyB5Gjnay9jeA1fQi90BCiRR4KxcMt/vDPIqiyd3dVT/4W+2qfoRgsDLMWBiJodY6Z/ vmb6ieFe33wfEo5L3qk/+gpSauOromby6ETYiVlgaiDQvF8BIE521/xcP/dzycI4Lxvc 3FKEi36AAQcFo2h9wdEdCOdYuYCJwqsIaobYA8nlgekNwAiQ4sPVh2uBFrjpxG2SX4Lk qVrJY2nhLOpqOyKwG2GQ+JN+KM72DRt+wp2Zv274Nl0s2uaFILffny4K9kHVaRJe14MW N2dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=Hv3lXfpV; 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 z25si6546739ejl.386.2020.09.06.12.34.04; Sun, 06 Sep 2020 12:34:27 -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=Hv3lXfpV; 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 S1726640AbgIFTa5 (ORCPT + 99 others); Sun, 6 Sep 2020 15:30:57 -0400 Received: from crapouillou.net ([89.234.176.41]:35906 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbgIFTay (ORCPT ); Sun, 6 Sep 2020 15:30:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599420591; 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=y2/qoY5aq9uuajDol9rdVEk/7JkYe+8OE3f4k4iL/AA=; b=Hv3lXfpVEAg+vKMo2Gtv+8JNhZuejVG941fc414L58zwJ6guHtoLy9b28W53xZ6Pd5jOid DYGeNwRQF9vspKM/Fa25hcyJw8mmYr07IPQTK0msYJZKWQPOdVLEoIJ35QN/TdUcq3HIHq 9DvGtwFvISzgrslN2DUyH3ldBRHUKos= From: Paul Cercueil To: Thomas Bogendoerfer Cc: "Maciej W . Rozycki" , Paul Burton , Zhou Yanjie , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 07/15] MIPS: generic: Init command line with fw_init_cmdline() Date: Sun, 6 Sep 2020 21:29:27 +0200 Message-Id: <20200906192935.107086-8-paul@crapouillou.net> In-Reply-To: <20200906192935.107086-1-paul@crapouillou.net> References: <20200906192935.107086-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 v3: No change 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