Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1381412pxb; Thu, 4 Mar 2021 09:51:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJytXXnX40yU0CLbqIk3JPq9iNT3i+2Yva1/AEQj3+NPDQVRr/gk29n6bZKtJGW0RMC/f/KN X-Received: by 2002:aa7:df14:: with SMTP id c20mr5673471edy.197.1614880298709; Thu, 04 Mar 2021 09:51:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614880298; cv=none; d=google.com; s=arc-20160816; b=EgUi30uCVkwYnCkst3IICJ0ACObKMv0kv4IpfoYOZW7LN43Oz0Fn9txBnLQTnTZbe/ yvC74BTRGW2kGGCFY6vijAB64B1hab1MO/2HZSQalCuUFlGq3GaoSM01/bctvCzOtRrE TTUORxXFyAm+IglPUfksR29EdHowZoU753RZcimrLLx+aWcP/QDdKvOkItPl1Uhnd0ei tRyK2AVK1XA38ejBI0v1FST7UtirHk4muDrOi4YCkEWfs1YNTZ1at+u3LX6nTbubl4qR EEo4KNjHxm3W9D7sVc48sOJ7fsdxNxyoCSrQAavRs8ecdeAKsPcmYIXAmjfo/HVqNq+O nDxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IOiYomiQmUpXbuXFbkFQ91APejBCQLZDoCN0LM66SsQ=; b=wEKfm5zx0PqybRjOy7/+Rrmp60hK9rPwSlU4ZMZgj8zij9xGvR5BNAW4lWErEaKXzK HtiDguUbfiIdku7kMJIGBmWwwRu6ilIlL6nXIKD/ssiQd8axB6MGUwtQdd0/U4RTItJR zCqDtKTfaNE8gM0kJIlYpz/LOJBck95qWXtIbOAMlRA3kfJRSAXT4DhdvHO+6hYY1HE6 jkJXospOpEFtfZUVIYRbdM3DGI980IEdeDG+BUzOwoLQRYe+/OMXpQeOv02RMCrhYNGh Q32BJY0U0mFR5UBUk2fgtWKpYB2WpTqGI4U1wxqhXy8+IycfwRznXVtVXGtz/+CgiJkE X4cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SUFTMJXC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si106752ede.102.2021.03.04.09.51.16; Thu, 04 Mar 2021 09:51:38 -0800 (PST) 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=pass header.i=@kernel.org header.s=k20201202 header.b=SUFTMJXC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbhCDOd4 (ORCPT + 99 others); Thu, 4 Mar 2021 09:33:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:52812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230390AbhCDOdf (ORCPT ); Thu, 4 Mar 2021 09:33:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFD2164F2C; Thu, 4 Mar 2021 14:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614868375; bh=tXeyflvi5gXEFLfWrEhyPYpQ9H6G+alEokJ1yiiFZAs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SUFTMJXCghhXPTfTU7DVatK7XQYGDso/6+901ptTAr+6UkFzvVY3LMy1bIBwg4Q82 isDF6GXrYzW1tsDNFKNmrnfQGi9Pq81iowaq3SFhnU9RUHy15KF384r3EJ495u9xU3 NCq881YQgUwtaNX3jPN2E0VR267kElrANWeJxmprwDTzSzDN1p8sT8jooPzXarYvDy mtBUdM42PWgJcC5evM+Re9wAYHKdY7ascu2Ek0ewIpvA8DtzgZz7SB9ab2syZ5KtWl VoNwX5CEdlZXGVJHEGyKYrWFY4mx9bYABQrAxfY4zQG8EPOnKH7l5Y26oldHmtbElN VJRGrvRWooQLg== Received: by mail-ed1-f46.google.com with SMTP id b7so21610116edz.8; Thu, 04 Mar 2021 06:32:54 -0800 (PST) X-Gm-Message-State: AOAM532ouOycI6Al4VVty7+nROx9MFQaXnS2SEq10S8e1r/sQNZ+NUmk hUrNWqVfSCerICKJTKdw8eKxm37z7v1HctTmIQ== X-Received: by 2002:aa7:c403:: with SMTP id j3mr4615939edq.137.1614868373460; Thu, 04 Mar 2021 06:32:53 -0800 (PST) MIME-Version: 1.0 References: <20210304044803.812204-2-danielwa@cisco.com> In-Reply-To: <20210304044803.812204-2-danielwa@cisco.com> From: Rob Herring Date: Thu, 4 Mar 2021 08:32:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/5] CMDLINE: drivers: of: ifdef out cmdline section To: Daniel Walker Cc: Will Deacon , Christophe Leroy , Daniel Gimpelevich , Andrew Morton , X86 ML , "open list:MIPS" , linuxppc-dev , Frank Rowand , xe-linux-external@cisco.com, Ruslan Ruslichenko , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 3, 2021 at 10:48 PM Daniel Walker wrote: > > It looks like there's some seepage of cmdline stuff into > the generic device tree code. This conflicts with the > generic cmdline implementation so I remove it in the case > when that's enabled. > > Cc: xe-linux-external@cisco.com > Signed-off-by: Ruslan Ruslichenko > Signed-off-by: Daniel Walker > --- > drivers/of/fdt.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index feb0f2d67fc5..cfe4f8d3c9f5 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > #include /* for COMMAND_LINE_SIZE */ > #include > @@ -1048,8 +1049,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > > early_init_dt_check_for_initrd(node); > > +#ifdef CONFIG_GENERIC_CMDLINE What I like about Christophe's version is it removes the old DT implementation. Who's going to convert the rest of the DT based arches? That's arm, arm64, hexagon, microblaze, nios2, openrisc, riscv, sh, and xtensa. Either separate the common code from the config like Christophe's version or these all need converting. Though it's fine to hash out patch 1 with a couple of arches first. > /* Retrieve command line */ > p = of_get_flat_dt_prop(node, "bootargs", &l); This needs to be outside the ifdef. > + > + /* > + * The builtin command line will be added here, or it can override > + * with the DT bootargs. > + */ > + cmdline_add_builtin(data, > + ((p != NULL && l > 0) ? p : NULL), /* This is sanity checking */ > + COMMAND_LINE_SIZE); > +#else > if (p != NULL && l > 0) > strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); > > @@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); > #endif > #endif /* CONFIG_CMDLINE */ > +#endif /* CONFIG_GENERIC_CMDLINE */ > > pr_debug("Command line is: %s\n", (char *)data); > > -- > 2.25.1 >