From patchwork Wed Dec 14 21:12:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 9474719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17840607EE for ; Wed, 14 Dec 2016 21:15:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 099EF285E1 for ; Wed, 14 Dec 2016 21:15:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F21A42871E; Wed, 14 Dec 2016 21:15:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B6AE0285E1 for ; Wed, 14 Dec 2016 21:15:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cHGrc-0003ts-7h; Wed, 14 Dec 2016 21:13:24 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cHGrY-0003pu-9h for linux-arm-kernel@lists.infradead.org; Wed, 14 Dec 2016 21:13:21 +0000 Received: by mail-wm0-x243.google.com with SMTP id m203so1837068wma.3 for ; Wed, 14 Dec 2016 13:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o4b6fUJUSOuh+t4s0VoMsKtsz4Qi5ceOtsx7qGn4IVs=; b=pZzz41IVg+KatjsaG7TNFh3UdeoEt0sMbQw5xm/0CBu08+aUMF41stE66X+8s8KbOS 0EWseayENkJuqSBFWagW+4vrPlEdvIcM2lFZTV2pa6bpCg3UaFdRoVvD3kP7lzpnzg4p 5IsBFzdtoRV0T+FwAxq7L1o3+li86Jp58TSJYmX/TlLZoohKSAAyW4LtBWYZQY9HGBR0 rGD42dHY+EBdlVgkl6UIqOGec1sWsuZE6VBdwOgpXzFbdWlY3ILmu5YdYXcR1ce2cimG MSQYjuT8UGeGXgu5K2VFQe3Df6sPvBCb0dbWMAWF9nFnV0nxsPR7qF0uXUuo0RYbi9ZT gGIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o4b6fUJUSOuh+t4s0VoMsKtsz4Qi5ceOtsx7qGn4IVs=; b=H3vOBv/R2esS0YQNUT+AFKbhi4X7651nUr0PYDXfF4n4/tdSnJs2vYiWx593QAaQpU VDTxrvRihDCXheym5hZOVCQGl6pS2OAI7GEVsH3E+JLwO1Mifu0LbW9x2suZJR3SUrI+ kEb5s0I7+dC0RaqA5/slS2CZV9OBCuX6yLwJRoEuB5ES69I+L2khQJqOuaaDx66YyA5E RUiGowOyokxveMWiOIpGvzj1eDY8ElGmfMwDkHlNxRgj/2uiDpeDdbEZxiaxCvPzhRbQ 5OObfaMb/FG0a68GchnpxcnPn9sF4jwh4I5L7mEV5aY2qv41zCUXTDZnr5k2invvCT8s avLg== X-Gm-Message-State: AKaTC01UNCYnCL/A8OqKfLU4Mm8ylIfMyrvLThhceE8zC9PCdNMZElATI5UYziWpVcReeQ== X-Received: by 10.28.142.16 with SMTP id q16mr8680640wmd.35.1481749978169; Wed, 14 Dec 2016 13:12:58 -0800 (PST) Received: from Pali-Latitude.lan (pali.kolej.mff.cuni.cz. [78.128.193.202]) by smtp.gmail.com with ESMTPSA id 204sm9375899wmj.7.2016.12.14.13.12.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Dec 2016 13:12:57 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Russell King , Arnd Bergmann , Robin Murphy , Linus Walleij , Ben Dooks , Tony Lindgren , Ivaylo Dimitrov , Sebastian Reichel , Aaro Koskinen , Pavel Machek Subject: [PATCH] arm: dt: Initialize boot_command_line from CONFIG_CMDLINE in case DT does not provide /chosen/bootargs Date: Wed, 14 Dec 2016 22:12:43 +0100 Message-Id: <1481749963-8664-1-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161214_131320_576220_95224F1B X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE. It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt(). This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty. Signed-off-by: Pali Rohár Acked-by: Pavel Machek Acked-by: Tony Lindgren --- arch/arm/kernel/devtree.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index f676feb..dbe25b1 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -260,6 +260,11 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) early_init_dt_scan_nodes(); +#ifdef CONFIG_CMDLINE + if (!boot_command_line[0]) + strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); +#endif + /* Change machine number to match the mdesc we're using */ __machine_arch_type = mdesc->nr;