[{"id":2658476,"web_url":"http://patchwork.ozlabs.org/comment/2658476/","msgid":"<CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>","date":"2021-03-30T19:49:13","subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","submitter":{"id":62529,"url":"http://patchwork.ozlabs.org/api/people/62529/","name":"Rob Herring (Arm)","email":"robh@kernel.org"},"content":"On Tue, Mar 30, 2021 at 12:57 PM Daniel Walker <danielwa@cisco.com> wrote:\n>\n> It looks like there's some seepage of cmdline stuff into\n> the generic device tree code. This conflicts with the\n> generic cmdline implementation so I remove it in the case\n> when that's enabled.\n>\n> Cc: xe-linux-external@cisco.com\n> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>\n> Signed-off-by: Daniel Walker <danielwa@cisco.com>\n> ---\n>  drivers/of/fdt.c | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n>\n> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c\n> index dcc1dd96911a..d8805cd9717a 100644\n> --- a/drivers/of/fdt.c\n> +++ b/drivers/of/fdt.c\n> @@ -25,6 +25,7 @@\n>  #include <linux/serial_core.h>\n>  #include <linux/sysfs.h>\n>  #include <linux/random.h>\n> +#include <linux/cmdline.h>\n>\n>  #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */\n>  #include <asm/page.h>\n> @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n>\n>         /* Retrieve command line */\n>         p = of_get_flat_dt_prop(node, \"bootargs\", &l);\n> +\n> +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)\n\nMoving in the wrong direction... This code already has too many\n#ifdef's. I like Christophe's version as it gets rid of all the code\nhere.\n\n> +       /*\n> +        * The builtin command line will be added here, or it can override\n> +        * with the DT bootargs.\n> +        */\n> +       cmdline_add_builtin(data,\n> +                           (l > 0 ? p : NULL), /* This is sanity checking */\n> +                           COMMAND_LINE_SIZE);\n> +#elif defined(CONFIG_GENERIC_CMDLINE)\n> +       strlcpy(data, p, COMMAND_LINE_SIZE);\n> +#else\n>         if (p != NULL && l > 0)\n>                 strlcpy(data, p, min(l, COMMAND_LINE_SIZE));\n>\n> @@ -1070,6 +1083,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n>                 strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);\n>  #endif\n>  #endif /* CONFIG_CMDLINE */\n> +#endif /* CONFIG_GENERIC_CMDLINE */\n>\n>         pr_debug(\"Command line is: %s\\n\", (char *)data);\n>\n> --\n> 2.25.1\n>","headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=gEcNh7zo;\n\tdkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=gEcNh7zo;\n\tdkim-atps=neutral","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org;\n envelope-from=robh@kernel.org; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=gEcNh7zo;\n dkim-atps=neutral"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4F90Ql6XMQz9sVS\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 31 Mar 2021 06:49:51 +1100 (AEDT)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4F90Ql5Zbzz3bv3\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 31 Mar 2021 06:49:51 +1100 (AEDT)","from mail.kernel.org (mail.kernel.org [198.145.29.99])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4F90QL2Cvfz3bqB\n for <linuxppc-dev@lists.ozlabs.org>; Wed, 31 Mar 2021 06:49:30 +1100 (AEDT)","by mail.kernel.org (Postfix) with ESMTPSA id 20875619CF\n for <linuxppc-dev@lists.ozlabs.org>; Tue, 30 Mar 2021 19:49:27 +0000 (UTC)","by mail-ej1-f42.google.com with SMTP id ce10so26609245ejb.6\n for <linuxppc-dev@lists.ozlabs.org>; Tue, 30 Mar 2021 12:49:27 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1617133767;\n bh=Ck1XHsPMXKddkO7/YY+lWQc5sW8Ayvngr37xovx4Afg=;\n h=References:In-Reply-To:From:Date:Subject:To:Cc:From;\n b=gEcNh7zo1605nJ8Hjwu4y4qAZxIi22sCNRw5bFtvEBODv+GcaOmodshXmLvXjV/t4\n yDViKbTiOEZs8Xg7AxAUYTWED/fmy1qnnrA6cnzJVkJU5ys2Fm9MoVyedghkW76SwD\n FCOVQBFKbAQQ986t/02MAQqbdli2694er9Ec9kjMM7c5EVZRW8UCgbTQQ2vQMM8dbT\n cimawJ7XvGtVIF9UwsSj9od7XaLHi9WEre1AKUaxPm6rzJc/+RlXz9yJaWBASK3oYK\n OhmRDT63nchAo7rm+sZqwAUBD4bVS10/D/ito1bQGxYshGgyNTN6AZm36Wic4i6V/d\n 1lysvtPWpYsDA==","X-Gm-Message-State":"AOAM5335hr8BDE+GlPl1QQGA3oQLnGV24st2h5GeOymaD0LopgD/D97H\n pxnUM3eIKhvmNzuyhg/zT06DTvIKw2nCRkrVuA==","X-Google-Smtp-Source":"\n ABdhPJwtsu4GSSCTGvon7NUuoXgbKxlglqptEfp3lbXOUs7+wjr+Z+gLBfdBRTrJqyuy+lFVou3niNRuxiswKCsp+tY=","X-Received":"by 2002:a17:906:c405:: with SMTP id\n u5mr35182498ejz.341.1617133765515;\n Tue, 30 Mar 2021 12:49:25 -0700 (PDT)","MIME-Version":"1.0","References":"\n <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>","In-Reply-To":"\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>","From":"Rob Herring <robh@kernel.org>","Date":"Tue, 30 Mar 2021 14:49:13 -0500","X-Gmail-Original-Message-ID":"\n <CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>","Message-ID":"\n <CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>","Subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","To":"Daniel Walker <danielwa@cisco.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, Ruslan Ruslichenko <rruslich@cisco.com>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Frank Rowand <frowand.list@gmail.com>,\n linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, X86 ML <x86@kernel.org>,\n \"open list:MIPS\" <linux-mips@vger.kernel.org>,\n \"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>,\n xe-linux-external@cisco.com, Andrew Morton <akpm@linux-foundation.org>,\n Will Deacon <will@kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":2658635,"web_url":"http://patchwork.ozlabs.org/comment/2658635/","msgid":"<20210330231717.GA2469518@zorba>","date":"2021-03-30T23:17:53","subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","submitter":{"id":67374,"url":"http://patchwork.ozlabs.org/api/people/67374/","name":"Daniel Walker (danielwa)","email":"danielwa@cisco.com"},"content":"On Tue, Mar 30, 2021 at 02:49:13PM -0500, Rob Herring wrote:\n> On Tue, Mar 30, 2021 at 12:57 PM Daniel Walker <danielwa@cisco.com> wrote:\n> >\n> > It looks like there's some seepage of cmdline stuff into\n> > the generic device tree code. This conflicts with the\n> > generic cmdline implementation so I remove it in the case\n> > when that's enabled.\n> >\n> > Cc: xe-linux-external@cisco.com\n> > Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>\n> > Signed-off-by: Daniel Walker <danielwa@cisco.com>\n> > ---\n> >  drivers/of/fdt.c | 14 ++++++++++++++\n> >  1 file changed, 14 insertions(+)\n> >\n> > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c\n> > index dcc1dd96911a..d8805cd9717a 100644\n> > --- a/drivers/of/fdt.c\n> > +++ b/drivers/of/fdt.c\n> > @@ -25,6 +25,7 @@\n> >  #include <linux/serial_core.h>\n> >  #include <linux/sysfs.h>\n> >  #include <linux/random.h>\n> > +#include <linux/cmdline.h>\n> >\n> >  #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */\n> >  #include <asm/page.h>\n> > @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n> >\n> >         /* Retrieve command line */\n> >         p = of_get_flat_dt_prop(node, \"bootargs\", &l);\n> > +\n> > +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)\n> \n> Moving in the wrong direction... This code already has too many\n> #ifdef's. I like Christophe's version as it gets rid of all the code\n> here.\n \nIt's temporary .. Notice CONFIG_GENERIC_CMDLINE_OF is only used on PowerPC. I\nexperienced doubling on arm64 when this was used (i.e. the append and prepend\nwas added twice).\n\nI don't think there are any other users which can't be moved outside the device\ntree code, but powerpc uses this function three times during boot up plus the\nprom_init user. It's possible to use the generic command line in all four places,\nbut it become space inefficient.\n\nSo the plan would be make the other architectures call the generic cmdline\ndirectly without this code, then powerpc would need to be reworked to call the\ngeneric commandline in it's own code hopefully just once.\n\nThe end results would be this section would reduce down to one string copy and\nno command line stuff.\n\nMaybe you would rather I just use the generic command line in those three place\nand reduce this at the space code of powerpc ?\n\nDaniel","headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=bXWTzX36;\n\tdkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=bXWTzX36;\n\tdkim-atps=neutral","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=cisco.com (client-ip=173.37.86.76; helo=rcdn-iport-5.cisco.com;\n envelope-from=danielwa@cisco.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=bXWTzX36; dkim-atps=neutral"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4F953Q3B62z9sX3\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 31 Mar 2021 10:18:26 +1100 (AEDT)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4F953Q26PCz3c5x\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 31 Mar 2021 10:18:26 +1100 (AEDT)","from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4F953150kKz30QX\n for <linuxppc-dev@lists.ozlabs.org>; Wed, 31 Mar 2021 10:18:03 +1100 (AEDT)","from rcdn-core-4.cisco.com ([173.37.93.155])\n by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 30 Mar 2021 23:17:55 +0000","from zorba ([10.24.9.230])\n by rcdn-core-4.cisco.com (8.15.2/8.15.2) with ESMTPS id 12UNHrtN009883\n (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);\n Tue, 30 Mar 2021 23:17:54 GMT"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=2382; q=dns/txt; s=iport;\n t=1617146285; x=1618355885;\n h=date:from:to:cc:subject:message-id:references:\n mime-version:in-reply-to;\n bh=NpSwJ7/ClV0xFgdKaewj2fSc7O+l5AnknwUQGTToK+Y=;\n b=bXWTzX36xf1xWz+/CgSU1MODb7wl85cLiXxFH9hoSD0FFabnveDKgfy6\n JIl0YrxdJM4xvjy9dW3MtZlb1SErblrbYI3XLCkh91svwcys+CnV3+qQJ\n zKUZbLUJ8+4RirKQOXoKq3BJ4laZkP4GLYK50DU483hKNlX5KPsUEOJN5 0=;","IronPort-HdrOrdr":"\n A9a23:EC8CkK39bx9e2WH6V837awqjBelyeYIsi2QD101hICF9WMbwra+Ttd4c0gL5jytUdXE7gNabOLSBR3S0z+8R3aA6O7C+UA76/Fa5NY0K1/qB/xTMEzDzn9Q26Y5OaK57YeecMXFbioLA7BC8A5IcxrC8gcSVrMP/61socg1wcaFn6G5Ce2WmO2l7XhNPC5Z8NLf03Kt6jgGtc3gWcci3b0NtN4P+jubGm578bRkNCwRP0mmzpAm14733GQXw5Hkjeg5IqI1PzUH11yTk+6PmiP2g0xnazWOW1YhOgcDs0MErPr3qtuElbhPxlw2veINtH5qFsTxdmpDX1H8a1P/RvhwnI8N/r0n0Q1jwix7s1w78uQxejUPf9Q==","X-IronPort-Anti-Spam-Filtered":"true","X-IronPort-Anti-Spam-Result":"\n A0BTAAAHsWNg/5tdJa1aHAEBAQEBAQcBARIBAQQEAQFAgTwHAQELAYIqgUwBOTGMZYkrA5AIFopFgXwLAQEBDQEBNAQBAYRQAoF6AiU0CQ4CAwEBDAEBBQEBAQIBBgRxhW6GRQEFOj8QCxguPBsGE4V4qxR1gTSJDIFEFA6BFwGNSSYcgUlChC4+iAuCKwSCQAcxXYIoEjcCk2kBikycIoMRgSOVGoYcMRCDdaBNuBICBAYFAhaBVDqBWTMaCBsVgyRQGQ2OKxaORiEDLzgCBgoBAQMJjDQsghkBAQ","X-IronPort-AV":"E=Sophos;i=\"5.81,291,1610409600\"; d=\"scan'208\";a=\"609596927\"","Date":"Tue, 30 Mar 2021 16:17:53 -0700","From":"Daniel Walker <danielwa@cisco.com>","To":"Rob Herring <robh@kernel.org>","Subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","Message-ID":"<20210330231717.GA2469518@zorba>","References":"\n <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>\n <CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"\n <CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>","X-Auto-Response-Suppress":"DR, OOF, AutoReply","X-Outbound-SMTP-Client":"10.24.9.230, [10.24.9.230]","X-Outbound-Node":"rcdn-core-4.cisco.com","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, Ruslan Ruslichenko <rruslich@cisco.com>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Frank Rowand <frowand.list@gmail.com>,\n linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, X86 ML <x86@kernel.org>,\n \"open list:MIPS\" <linux-mips@vger.kernel.org>,\n \"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>,\n xe-linux-external@cisco.com, Andrew Morton <akpm@linux-foundation.org>,\n Will Deacon <will@kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":2660523,"web_url":"http://patchwork.ozlabs.org/comment/2660523/","msgid":"<6d50809a-eb6b-b8bb-bb8b-88f66c52c0fa@csgroup.eu>","date":"2021-04-02T17:32:08","subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","submitter":{"id":79086,"url":"http://patchwork.ozlabs.org/api/people/79086/","name":"Christophe Leroy","email":"christophe.leroy@csgroup.eu"},"content":"Le 30/03/2021 à 19:56, Daniel Walker a écrit :\n> It looks like there's some seepage of cmdline stuff into\n> the generic device tree code. This conflicts with the\n> generic cmdline implementation so I remove it in the case\n> when that's enabled.\n> \n> Cc: xe-linux-external@cisco.com\n> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>\n> Signed-off-by: Daniel Walker <danielwa@cisco.com>\n> ---\n>   drivers/of/fdt.c | 14 ++++++++++++++\n>   1 file changed, 14 insertions(+)\n> \n> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c\n> index dcc1dd96911a..d8805cd9717a 100644\n> --- a/drivers/of/fdt.c\n> +++ b/drivers/of/fdt.c\n> @@ -25,6 +25,7 @@\n>   #include <linux/serial_core.h>\n>   #include <linux/sysfs.h>\n>   #include <linux/random.h>\n> +#include <linux/cmdline.h>\n>   \n>   #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */\n>   #include <asm/page.h>\n> @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n>   \n>   \t/* Retrieve command line */\n>   \tp = of_get_flat_dt_prop(node, \"bootargs\", &l);\n> +\n> +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)\n> +\t/*\n> +\t * The builtin command line will be added here, or it can override\n> +\t * with the DT bootargs.\n> +\t */\n> +\tcmdline_add_builtin(data,\n> +\t\t\t    (l > 0 ? p : NULL), /* This is sanity checking */\n> +\t\t\t    COMMAND_LINE_SIZE);\n> +#elif defined(CONFIG_GENERIC_CMDLINE)\n> +\tstrlcpy(data, p, COMMAND_LINE_SIZE);\n> +#else\n\nUgly.\n\nLinux codying style recommend to limit the use of #ifdefs to headers as much as possible.\n\nWhy do we need so many alternatives ? Allthough they are temporary, can we order the changes in \nanother way to reduce that ?\n\n>   \tif (p != NULL && l > 0)\n>   \t\tstrlcpy(data, p, min(l, COMMAND_LINE_SIZE));\n>   \n> @@ -1070,6 +1083,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n>   \t\tstrlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);\n>   #endif\n>   #endif /* CONFIG_CMDLINE */\n> +#endif /* CONFIG_GENERIC_CMDLINE */\n>   \n>   \tpr_debug(\"Command line is: %s\\n\", (char *)data);\n>   \n>","headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr;\n envelope-from=christophe.leroy@csgroup.eu; receiver=<UNKNOWN>)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4FBnDx4bMdz9sVt\n\tfor <patchwork-incoming@ozlabs.org>; Sat,  3 Apr 2021 04:32:33 +1100 (AEDT)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4FBnDx3d38z3c66\n\tfor <patchwork-incoming@ozlabs.org>; Sat,  3 Apr 2021 04:32:33 +1100 (AEDT)","from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4FBnDd2jpKz3btY\n for <linuxppc-dev@lists.ozlabs.org>; Sat,  3 Apr 2021 04:32:16 +1100 (AEDT)","from localhost (mailhub1-int [192.168.12.234])\n by localhost (Postfix) with ESMTP id 4FBnDW1HYQz9v3qR;\n Fri,  2 Apr 2021 19:32:11 +0200 (CEST)","from pegase1.c-s.fr ([192.168.12.234])\n by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024)\n with ESMTP id JHnZja8v_c6i; Fri,  2 Apr 2021 19:32:11 +0200 (CEST)","from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192])\n by pegase1.c-s.fr (Postfix) with ESMTP id 4FBnDW0PJdz9v3qQ;\n Fri,  2 Apr 2021 19:32:11 +0200 (CEST)","from localhost (localhost [127.0.0.1])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id 2E6368BB77;\n Fri,  2 Apr 2021 19:32:13 +0200 (CEST)","from messagerie.si.c-s.fr ([127.0.0.1])\n by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023)\n with ESMTP id ipqYX6I0tWmG; Fri,  2 Apr 2021 19:32:13 +0200 (CEST)","from [192.168.4.90] (unknown [192.168.4.90])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id 32C7A8BB6F;\n Fri,  2 Apr 2021 19:32:12 +0200 (CEST)"],"X-Virus-Scanned":["Debian amavisd-new at c-s.fr","amavisd-new at c-s.fr"],"Subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","To":"Daniel Walker <danielwa@cisco.com>, Will Deacon <will@kernel.org>,\n ob Herring <robh@kernel.org>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Andrew Morton <akpm@linux-foundation.org>, x86@kernel.org,\n linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,\n Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>","References":"\n <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>","From":"Christophe Leroy <christophe.leroy@csgroup.eu>","Message-ID":"<6d50809a-eb6b-b8bb-bb8b-88f66c52c0fa@csgroup.eu>","Date":"Fri, 2 Apr 2021 19:32:08 +0200","User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101\n Thunderbird/78.9.0","MIME-Version":"1.0","In-Reply-To":"\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"fr","Content-Transfer-Encoding":"8bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, Ruslan Ruslichenko <rruslich@cisco.com>,\n linux-kernel@vger.kernel.org, xe-linux-external@cisco.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":2661833,"web_url":"http://patchwork.ozlabs.org/comment/2661833/","msgid":"<20210406163549.GS2469518@zorba>","date":"2021-04-06T16:35:49","subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","submitter":{"id":67374,"url":"http://patchwork.ozlabs.org/api/people/67374/","name":"Daniel Walker (danielwa)","email":"danielwa@cisco.com"},"content":"On Fri, Apr 02, 2021 at 07:32:08PM +0200, Christophe Leroy wrote:\n> \n> \n> Le 30/03/2021 à 19:56, Daniel Walker a écrit :\n> > It looks like there's some seepage of cmdline stuff into\n> > the generic device tree code. This conflicts with the\n> > generic cmdline implementation so I remove it in the case\n> > when that's enabled.\n> > \n> > Cc: xe-linux-external@cisco.com\n> > Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>\n> > Signed-off-by: Daniel Walker <danielwa@cisco.com>\n> > ---\n> >   drivers/of/fdt.c | 14 ++++++++++++++\n> >   1 file changed, 14 insertions(+)\n> > \n> > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c\n> > index dcc1dd96911a..d8805cd9717a 100644\n> > --- a/drivers/of/fdt.c\n> > +++ b/drivers/of/fdt.c\n> > @@ -25,6 +25,7 @@\n> >   #include <linux/serial_core.h>\n> >   #include <linux/sysfs.h>\n> >   #include <linux/random.h>\n> > +#include <linux/cmdline.h>\n> >   #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */\n> >   #include <asm/page.h>\n> > @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n> >   \t/* Retrieve command line */\n> >   \tp = of_get_flat_dt_prop(node, \"bootargs\", &l);\n> > +\n> > +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)\n> > +\t/*\n> > +\t * The builtin command line will be added here, or it can override\n> > +\t * with the DT bootargs.\n> > +\t */\n> > +\tcmdline_add_builtin(data,\n> > +\t\t\t    (l > 0 ? p : NULL), /* This is sanity checking */\n> > +\t\t\t    COMMAND_LINE_SIZE);\n> > +#elif defined(CONFIG_GENERIC_CMDLINE)\n> > +\tstrlcpy(data, p, COMMAND_LINE_SIZE);\n> > +#else\n> \n> Ugly.\n> \n> Linux codying style recommend to limit the use of #ifdefs to headers as much as possible.\n> \n> Why do we need so many alternatives ? Allthough they are temporary, can we\n> order the changes in another way to reduce that ?\n\nI think this whole section can be removed down even all the CMDLINE ifdef's ..\nThe only architecture which needs this is powerpc because it calls this function\nthree times.\n\nIf powerpc were made to call this only once , and then call the generic handling\nfor the command line then this whole section would get removed.\n\nDaniel","headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=Bvtpg24u;\n\tdkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=Bvtpg24u;\n\tdkim-atps=neutral","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=cisco.com (client-ip=173.37.86.75; helo=rcdn-iport-4.cisco.com;\n envelope-from=danielwa@cisco.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=Bvtpg24u; dkim-atps=neutral"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4FFCpB2z0rz9sRf\n\tfor <patchwork-incoming@ozlabs.org>; Wed,  7 Apr 2021 02:36:18 +1000 (AEST)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4FFCpB1n4lz2yRZ\n\tfor <patchwork-incoming@ozlabs.org>; Wed,  7 Apr 2021 02:36:18 +1000 (AEST)","from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4FFCnm1x7Nz2yQq\n for <linuxppc-dev@lists.ozlabs.org>; Wed,  7 Apr 2021 02:35:55 +1000 (AEST)","from alln-core-7.cisco.com ([173.36.13.140])\n by rcdn-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 06 Apr 2021 16:35:52 +0000","from zorba ([10.24.14.212])\n by alln-core-7.cisco.com (8.15.2/8.15.2) with ESMTPS id 136GZnnO027751\n (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);\n Tue, 6 Apr 2021 16:35:51 GMT"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=2214; q=dns/txt; s=iport;\n t=1617726956; x=1618936556;\n h=date:from:to:cc:subject:message-id:references:\n mime-version:content-transfer-encoding:in-reply-to;\n bh=YVi6Pd95NNQkukWDzEdKyppnaWlfPPnzy+EUME4WOBg=;\n b=Bvtpg24upCCtKIhYKsdV95qjdSUMTXLd3wvXoZoxGYKzh92tyyQfUND3\n A4KNoXW+NONnaRcgANwc0HKLNyZXdB575vFOu5/a7lGFvYYJS3pP649UI\n 8tNvWjHe/7UB+qV41zQYzKdBwiMxdDnoHXtpC04OP8OMUw4Vc4V28gBdG o=;","IronPort-HdrOrdr":"\n A9a23:7NO2kKE3yH2CO2oOpLqFkpHXdLJzesId70hD6mlaQ3VuHfCwvcaogfgdyFvYiCwJXmshhNCHP8C7MBbh3LRy5pQcOqrnYRLvv3GmIJonwYzpxTDhHCOWzJ846Y5Lda9iBNrsSWVrlMqS2njbL/8MyMSKmZrDuc7w1HFoJDsGV4hB6ENDBh+fAglKQmB9dP0EPb69wuYCmDa6Y3QQaa2Adxo4dszOvcfCmp6jQTNuPX8awTKDhz+p97L2eiLwtnwjeghCzrs4/W/OnxaR3MWemsumwRzR3XK71fprsebmo+EuOOW8zuAINzOpsQqzfYJnQbHHhiwtufqi8kxCqqirnz4Qe+Ju9njWYma55Tzq1gWI6kdX11bSjXmFnHDkvcv1AAgfNvMEr4dYfhzFgnBQxe1B7A==","X-IronPort-Anti-Spam-Filtered":"true","X-IronPort-Anti-Spam-Result":"\n A0AKAAAkjWxg/4wNJK1aGgEBAQEBAQEBAQEDAQEBARIBAQEBAgIBAQEBQIE+BQEBAQELAYIqgU0BOTGMZokuA5AMFopGFIFoCwEBAQ0BATQEAQGBFgGDNAMCAoF2AiU0CQ4CAwEBDAEBBQEBAQIBBgRxE4VdhkUBBTIBRhALEgYuPA0OBhOFeatQdYE0gQGIHYFEFA6BFwGNTCccgUlCgRODIj6EGA6GEQSCQAeBDoIVExKULIpcnCmDFYEmj1qLbTIQpGG4PgIEBgUCFoFUOoFZMxoIGxWDJFAZDp0IIQMvOAIGAQkBAQMJin8BJwSCGQEB","X-IronPort-AV":"E=Sophos;i=\"5.82,310,1613433600\"; d=\"scan'208\";a=\"857074414\"","Date":"Tue, 6 Apr 2021 09:35:49 -0700","From":"Daniel Walker <danielwa@cisco.com>","To":"Christophe Leroy <christophe.leroy@csgroup.eu>","Subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","Message-ID":"<20210406163549.GS2469518@zorba>","References":"\n <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>\n <6d50809a-eb6b-b8bb-bb8b-88f66c52c0fa@csgroup.eu>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<6d50809a-eb6b-b8bb-bb8b-88f66c52c0fa@csgroup.eu>","X-Auto-Response-Suppress":"DR, OOF, AutoReply","X-Outbound-SMTP-Client":"10.24.14.212, [10.24.14.212]","X-Outbound-Node":"alln-core-7.cisco.com","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"ob Herring <robh@kernel.org>, Ruslan Ruslichenko <rruslich@cisco.com>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Frank Rowand <frowand.list@gmail.com>, devicetree@vger.kernel.org,\n linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-mips@vger.kernel.org,\n linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,\n xe-linux-external@cisco.com, Andrew Morton <akpm@linux-foundation.org>,\n Will Deacon <will@kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":2662802,"web_url":"http://patchwork.ozlabs.org/comment/2662802/","msgid":"<20210407225915.GA147338@robh.at.kernel.org>","date":"2021-04-07T22:59:15","subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","submitter":{"id":62529,"url":"http://patchwork.ozlabs.org/api/people/62529/","name":"Rob Herring (Arm)","email":"robh@kernel.org"},"content":"On Tue, Mar 30, 2021 at 04:17:53PM -0700, Daniel Walker wrote:\n> On Tue, Mar 30, 2021 at 02:49:13PM -0500, Rob Herring wrote:\n> > On Tue, Mar 30, 2021 at 12:57 PM Daniel Walker <danielwa@cisco.com> wrote:\n> > >\n> > > It looks like there's some seepage of cmdline stuff into\n> > > the generic device tree code. This conflicts with the\n> > > generic cmdline implementation so I remove it in the case\n> > > when that's enabled.\n> > >\n> > > Cc: xe-linux-external@cisco.com\n> > > Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>\n> > > Signed-off-by: Daniel Walker <danielwa@cisco.com>\n> > > ---\n> > >  drivers/of/fdt.c | 14 ++++++++++++++\n> > >  1 file changed, 14 insertions(+)\n> > >\n> > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c\n> > > index dcc1dd96911a..d8805cd9717a 100644\n> > > --- a/drivers/of/fdt.c\n> > > +++ b/drivers/of/fdt.c\n> > > @@ -25,6 +25,7 @@\n> > >  #include <linux/serial_core.h>\n> > >  #include <linux/sysfs.h>\n> > >  #include <linux/random.h>\n> > > +#include <linux/cmdline.h>\n> > >\n> > >  #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */\n> > >  #include <asm/page.h>\n> > > @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n> > >\n> > >         /* Retrieve command line */\n> > >         p = of_get_flat_dt_prop(node, \"bootargs\", &l);\n> > > +\n> > > +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)\n> > \n> > Moving in the wrong direction... This code already has too many\n> > #ifdef's. I like Christophe's version as it gets rid of all the code\n> > here.\n>  \n> It's temporary .. Notice CONFIG_GENERIC_CMDLINE_OF is only used on PowerPC. I\n> experienced doubling on arm64 when this was used (i.e. the append and prepend\n> was added twice).\n> \n> I don't think there are any other users which can't be moved outside the device\n> tree code, but powerpc uses this function three times during boot up plus the\n> prom_init user. It's possible to use the generic command line in all four places,\n> but it become space inefficient.\n\nWhat's the 3rd use? I count kaslr code and in \nearly_init_dt_scan_chosen_ppc. Do we need to build the command line for \nkaslr seed? Getting any build time value from the kernel is pointless.\n\nRob","headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=gmail.com (client-ip=209.85.210.43;\n helo=mail-ot1-f43.google.com;\n envelope-from=robherring2@gmail.com; receiver=<UNKNOWN>)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4FG0G035htz9sVt\n\tfor <patchwork-incoming@ozlabs.org>; Thu,  8 Apr 2021 08:59:36 +1000 (AEST)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4FG0G02FmXz3bx9\n\tfor <patchwork-incoming@ozlabs.org>; Thu,  8 Apr 2021 08:59:36 +1000 (AEST)","from mail-ot1-f43.google.com (mail-ot1-f43.google.com\n [209.85.210.43])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4FG0Fh38mKz2yxn\n for <linuxppc-dev@lists.ozlabs.org>; Thu,  8 Apr 2021 08:59:19 +1000 (AEST)","by mail-ot1-f43.google.com with SMTP id\n w31-20020a9d36220000b02901f2cbfc9743so435578otb.7\n for <linuxppc-dev@lists.ozlabs.org>; Wed, 07 Apr 2021 15:59:19 -0700 (PDT)","from robh.at.kernel.org (24-155-109-49.dyn.grandenetworks.net.\n [24.155.109.49])\n by smtp.gmail.com with ESMTPSA id b22sm5786887ots.59.2021.04.07.15.59.15\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 07 Apr 2021 15:59:16 -0700 (PDT)","(nullmailer pid 174484 invoked by uid 1000);\n Wed, 07 Apr 2021 22:59:15 -0000"],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:date:from:to:cc:subject:message-id:references\n :mime-version:content-disposition:in-reply-to;\n bh=QKXgCn18Rr1eqfdzx55WXMaeSuXNDv2BM9yLmUwClbs=;\n b=sRFoW6WIbrafylp4u8YQwmLO2oUI/YE2sHU5+ABsk0/MURj+sZlilEobcMEbGeUqwz\n IRKvY8niNH2hn0VV25DYFtdCEFncflRwCFryIEGm72eaUF8FOh32tTcBzQCmzm9uQosS\n 5HOnksz1XFiiwbMbaDuV8dCiNVzlV2urYyhuhcWOzJMgJFdaYgGKCBKXC/fXWfYlg9fA\n GjR/nJtm+uylGi3Mf8dFKIu2ir9ZOa0mm4nGIjScoeYIKOF+NdEkRjKdeoYAs+072AWY\n SCBMqUrcUA1RhwXyIayafu6sTHRahBHp3OLB+IigBBOmYnsJ0bPMhdJofpJwkYz3vmCh\n h3sQ==","X-Gm-Message-State":"AOAM530c08PDDetxuNYBqET1sGGxsAAbjf1sRLZVoP2Mcnw2iQpUwF4M\n lB/rwxRdRa9FB0baDl0D5w==","X-Google-Smtp-Source":"\n ABdhPJyvr5jHBGk0riO06gjL1cJLFcP8LjEM1PludhoIvgfnmnAE6t/+wBnt/64MHZhkodj4W6TLdA==","X-Received":"by 2002:a05:6830:22c3:: with SMTP id\n q3mr4869906otc.56.1617836356986;\n Wed, 07 Apr 2021 15:59:16 -0700 (PDT)","Date":"Wed, 7 Apr 2021 17:59:15 -0500","From":"Rob Herring <robh@kernel.org>","To":"Daniel Walker <danielwa@cisco.com>","Subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","Message-ID":"<20210407225915.GA147338@robh.at.kernel.org>","References":"\n <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>\n <CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>\n <20210330231717.GA2469518@zorba>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20210330231717.GA2469518@zorba>","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, Ruslan Ruslichenko <rruslich@cisco.com>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Frank Rowand <frowand.list@gmail.com>,\n linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, X86 ML <x86@kernel.org>,\n \"open list:MIPS\" <linux-mips@vger.kernel.org>,\n \"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>,\n xe-linux-external@cisco.com, Andrew Morton <akpm@linux-foundation.org>,\n Will Deacon <will@kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":2663810,"web_url":"http://patchwork.ozlabs.org/comment/2663810/","msgid":"<20210409012657.GH3981976@zorba>","date":"2021-04-09T01:26:57","subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","submitter":{"id":67374,"url":"http://patchwork.ozlabs.org/api/people/67374/","name":"Daniel Walker (danielwa)","email":"danielwa@cisco.com"},"content":"On Wed, Apr 07, 2021 at 05:59:15PM -0500, Rob Herring wrote:\n> On Tue, Mar 30, 2021 at 04:17:53PM -0700, Daniel Walker wrote:\n> > On Tue, Mar 30, 2021 at 02:49:13PM -0500, Rob Herring wrote:\n> > > On Tue, Mar 30, 2021 at 12:57 PM Daniel Walker <danielwa@cisco.com> wrote:\n> > > >\n> > > > It looks like there's some seepage of cmdline stuff into\n> > > > the generic device tree code. This conflicts with the\n> > > > generic cmdline implementation so I remove it in the case\n> > > > when that's enabled.\n> > > >\n> > > > Cc: xe-linux-external@cisco.com\n> > > > Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>\n> > > > Signed-off-by: Daniel Walker <danielwa@cisco.com>\n> > > > ---\n> > > >  drivers/of/fdt.c | 14 ++++++++++++++\n> > > >  1 file changed, 14 insertions(+)\n> > > >\n> > > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c\n> > > > index dcc1dd96911a..d8805cd9717a 100644\n> > > > --- a/drivers/of/fdt.c\n> > > > +++ b/drivers/of/fdt.c\n> > > > @@ -25,6 +25,7 @@\n> > > >  #include <linux/serial_core.h>\n> > > >  #include <linux/sysfs.h>\n> > > >  #include <linux/random.h>\n> > > > +#include <linux/cmdline.h>\n> > > >\n> > > >  #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */\n> > > >  #include <asm/page.h>\n> > > > @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n> > > >\n> > > >         /* Retrieve command line */\n> > > >         p = of_get_flat_dt_prop(node, \"bootargs\", &l);\n> > > > +\n> > > > +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)\n> > > \n> > > Moving in the wrong direction... This code already has too many\n> > > #ifdef's. I like Christophe's version as it gets rid of all the code\n> > > here.\n> >  \n> > It's temporary .. Notice CONFIG_GENERIC_CMDLINE_OF is only used on PowerPC. I\n> > experienced doubling on arm64 when this was used (i.e. the append and prepend\n> > was added twice).\n> > \n> > I don't think there are any other users which can't be moved outside the device\n> > tree code, but powerpc uses this function three times during boot up plus the\n> > prom_init user. It's possible to use the generic command line in all four places,\n> > but it become space inefficient.\n> \n> What's the 3rd use? I count kaslr code and in \n> early_init_dt_scan_chosen_ppc. Do we need to build the command line for \n> kaslr seed? Getting any build time value from the kernel is pointless.\n\nI think I may have been mistaken. I added a dump_stack() , but there may have\nbeen other stack traces during bootup on prior -rcX's I was testing.\n\nI re-ran the test and I only see one user on powerpc and powerpc64,\n\npowerpc64,\n\n[    T0] Call Trace:\n[    T0] [c000000001517d00] [c00000000077e910] dump_stack+0xc4/0x114 (unreliable)\n[    T0] [c000000001517d50] [c000000001186fb4] early_init_dt_scan_chosen+0x238/0x324\n[    T0] [c000000001517de0] [c000000001138b00] early_init_dt_scan_chosen_ppc+0x20/0x194\n[    T0] [c000000001517e10] [c000000001186ae0] of_scan_flat_dt+0xc8/0x130\n[    T0] [c000000001517e70] [c000000001139404] early_init_devtree+0xa4/0x48c\n[    T0] [c000000001517f10] [c00000000113ac90] early_setup+0xc8/0x254\n[    T0] [c000000001517f90] [000000000000c754] 0xc754\n\npowerpc32,\n\nCall Trace:\n[c06bbee0] [c067e334] early_init_dt_scan_chosen+0xf8/0x1dc (unreliable)\n[c06bbf10] [c0666ec4] early_init_dt_scan_chosen_ppc+0x18/0x6c\n[c06bbf30] [c067e048] of_scan_flat_dt+0x98/0xf4\n[c06bbf70] [c0667234] early_init_devtree+0x48/0x2d0\n[c06bbfb0] [c06679cc] machine_init+0x98/0xcc\n[c06bbff0] [c0000398] set_ivor+0x114/0x154\n\nI think it would be possible to just move the generic handling entire into\narchitecture code.\n\nDaniel","headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=DKeaA4F6;\n\tdkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=DKeaA4F6;\n\tdkim-atps=neutral","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=cisco.com (client-ip=173.37.86.80; helo=rcdn-iport-9.cisco.com;\n envelope-from=danielwa@cisco.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=DKeaA4F6; dkim-atps=neutral"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4FGgV45HxJz9sW1\n\tfor <patchwork-incoming@ozlabs.org>; Fri,  9 Apr 2021 11:27:24 +1000 (AEST)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4FGgV444tBz3bvl\n\tfor <patchwork-incoming@ozlabs.org>; Fri,  9 Apr 2021 11:27:24 +1000 (AEST)","from rcdn-iport-9.cisco.com (rcdn-iport-9.cisco.com [173.37.86.80])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4FGgTh1xBmz301k\n for <linuxppc-dev@lists.ozlabs.org>; Fri,  9 Apr 2021 11:27:03 +1000 (AEST)","from alln-core-9.cisco.com ([173.36.13.129])\n by rcdn-iport-9.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 09 Apr 2021 01:26:59 +0000","from zorba ([10.24.9.242])\n by alln-core-9.cisco.com (8.15.2/8.15.2) with ESMTPS id 1391Qv7b032706\n (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);\n Fri, 9 Apr 2021 01:26:58 GMT"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=3696; q=dns/txt; s=iport;\n t=1617931624; x=1619141224;\n h=date:from:to:cc:subject:message-id:references:\n mime-version:in-reply-to;\n bh=zMAEQSGGxAXPhVbwdo8g6BKr75SG96pClPfZ618q3KM=;\n b=DKeaA4F63TAfN68dX2VvdfuHSU4L1tiXwxIS10xb1phQag8SVt9hUU03\n seMWFx3wth3C8SjB+xxUHjSy1s25d9t1U769rBYzKdbiBCbY/GXAfjHYr\n D3+orHV46jtaNBc4X7/UOPmh+BedwvEqvOkg9f/Atqlu26tnt+3p/512F 0=;","IronPort-HdrOrdr":"\n A9a23:zTkORKl6L0U17Sf68XftOckLpnPpDfN3imdD5ilNYBxZY6Wkvuql9c516TbfjjENVHY83f2BIrCHW3PA9ZhziLNhWIuKdg/gpWeuMcVe/ZLvqgeQeRHW2+ZB2c5bGZRWJ8b3CTFB4PrSwA79KNo4xcnCzabAv5a7815IbSVHL55t9B14DAHzKDwUeCBjCYAiHJSRouprzgDARV0tYs62BmYIUoH4zrWhqLvcbRELHBIh4gWV5AnJ1JfBDxOa0h0COgkg/Z4e9wH+/zDR1+GKr+y8jiTRzXbU6I5b3OH808JZCNaX4/JlTQnEu0KPeJlrXaGEsXQTpuyigWxa6eXkklMHI9l57W/XcyWOhSbVnyPk0Doo9hbZuDmlvUc=","X-IronPort-Anti-Spam-Filtered":"true","X-IronPort-Anti-Spam-Result":"\n A0AEAABOrG9g/4ENJK1aGQEBAQEBAQEBAQEBAQEBAQEBARIBAQEBAQEBAQEBAQFAgT4EAQEBAQELAYIqgU0BOTGMZokxA5ANilyBfAsBAQENAQE0BAEBhFACgXcCJTQJDgIDAQEMAQEFAQEBAgEGBHEThV2GRQEFHhw/EAsSBi48DQ4GE4V5qjx1gTSBAYgUgUQUDoEXAY1MJxyBSUKENT6KOQSCQAeBDoIoEjcCk3MBilucKYMVgSaVJYYiMhCDeqBnuD4CBAYFAhaBVDqBWTMaCBsVgyRQGQ6OKxaORyEDLzgCBgoBAQMJikwsghkBAQ","X-IronPort-AV":"E=Sophos;i=\"5.82,208,1613433600\"; d=\"scan'208\";a=\"789889986\"","Date":"Thu, 8 Apr 2021 18:26:57 -0700","From":"Daniel Walker <danielwa@cisco.com>","To":"Rob Herring <robh@kernel.org>","Subject":"Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section","Message-ID":"<20210409012657.GH3981976@zorba>","References":"\n <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>\n <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>\n <CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>\n <20210330231717.GA2469518@zorba>\n <20210407225915.GA147338@robh.at.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20210407225915.GA147338@robh.at.kernel.org>","X-Auto-Response-Suppress":"DR, OOF, AutoReply","X-Outbound-SMTP-Client":"10.24.9.242, [10.24.9.242]","X-Outbound-Node":"alln-core-9.cisco.com","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, Ruslan Ruslichenko <rruslich@cisco.com>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Frank Rowand <frowand.list@gmail.com>,\n linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, X86 ML <x86@kernel.org>,\n \"open list:MIPS\" <linux-mips@vger.kernel.org>,\n \"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>,\n xe-linux-external@cisco.com, Andrew Morton <akpm@linux-foundation.org>,\n Will Deacon <will@kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]