[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210330231717.GA2469518@zorba>
Date: Tue, 30 Mar 2021 16:17:53 -0700
From: Daniel Walker <danielwa@...co.com>
To: Rob Herring <robh@...nel.org>
Cc: Will Deacon <will@...nel.org>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Daniel Gimpelevich <daniel@...pelevich.san-francisco.ca.us>,
Andrew Morton <akpm@...ux-foundation.org>,
X86 ML <x86@...nel.org>,
"open list:MIPS" <linux-mips@...r.kernel.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Frank Rowand <frowand.list@...il.com>,
xe-linux-external@...co.com,
Ruslan Ruslichenko <rruslich@...co.com>,
devicetree@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section
On Tue, Mar 30, 2021 at 02:49:13PM -0500, Rob Herring wrote:
> On Tue, Mar 30, 2021 at 12:57 PM Daniel Walker <danielwa@...co.com> 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@...co.com
> > Signed-off-by: Ruslan Ruslichenko <rruslich@...co.com>
> > Signed-off-by: Daniel Walker <danielwa@...co.com>
> > ---
> > drivers/of/fdt.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> > index dcc1dd96911a..d8805cd9717a 100644
> > --- a/drivers/of/fdt.c
> > +++ b/drivers/of/fdt.c
> > @@ -25,6 +25,7 @@
> > #include <linux/serial_core.h>
> > #include <linux/sysfs.h>
> > #include <linux/random.h>
> > +#include <linux/cmdline.h>
> >
> > #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
> > #include <asm/page.h>
> > @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> >
> > /* Retrieve command line */
> > p = of_get_flat_dt_prop(node, "bootargs", &l);
> > +
> > +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)
>
> Moving in the wrong direction... This code already has too many
> #ifdef's. I like Christophe's version as it gets rid of all the code
> here.
It's temporary .. Notice CONFIG_GENERIC_CMDLINE_OF is only used on PowerPC. I
experienced doubling on arm64 when this was used (i.e. the append and prepend
was added twice).
I don't think there are any other users which can't be moved outside the device
tree code, but powerpc uses this function three times during boot up plus the
prom_init user. It's possible to use the generic command line in all four places,
but it become space inefficient.
So the plan would be make the other architectures call the generic cmdline
directly without this code, then powerpc would need to be reworked to call the
generic commandline in it's own code hopefully just once.
The end results would be this section would reduce down to one string copy and
no command line stuff.
Maybe you would rather I just use the generic command line in those three place
and reduce this at the space code of powerpc ?
Daniel
Powered by blists - more mailing lists