From: Daniel Walker <danielwa@cisco.com>
To: Rob Herring <robh@kernel.org>
Cc: Will Deacon <will@kernel.org>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,
Andrew Morton <akpm@linux-foundation.org>,
X86 ML <x86@kernel.org>,
"open list:MIPS" <linux-mips@vger.kernel.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Frank Rowand <frowand.list@gmail.com>,
xe-linux-external@cisco.com,
Ruslan Ruslichenko <rruslich@cisco.com>,
devicetree@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section
Date: Thu, 8 Apr 2021 18:26:57 -0700 [thread overview]
Message-ID: <20210409012657.GH3981976@zorba> (raw)
In-Reply-To: <20210407225915.GA147338@robh.at.kernel.org>
On Wed, Apr 07, 2021 at 05:59:15PM -0500, Rob Herring wrote:
> On Tue, Mar 30, 2021 at 04:17:53PM -0700, Daniel Walker wrote:
> > 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@cisco.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@cisco.com
> > > > Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
> > > > Signed-off-by: Daniel Walker <danielwa@cisco.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.
>
> What's the 3rd use? I count kaslr code and in
> early_init_dt_scan_chosen_ppc. Do we need to build the command line for
> kaslr seed? Getting any build time value from the kernel is pointless.
I think I may have been mistaken. I added a dump_stack() , but there may have
been other stack traces during bootup on prior -rcX's I was testing.
I re-ran the test and I only see one user on powerpc and powerpc64,
powerpc64,
[ T0] Call Trace:
[ T0] [c000000001517d00] [c00000000077e910] dump_stack+0xc4/0x114 (unreliable)
[ T0] [c000000001517d50] [c000000001186fb4] early_init_dt_scan_chosen+0x238/0x324
[ T0] [c000000001517de0] [c000000001138b00] early_init_dt_scan_chosen_ppc+0x20/0x194
[ T0] [c000000001517e10] [c000000001186ae0] of_scan_flat_dt+0xc8/0x130
[ T0] [c000000001517e70] [c000000001139404] early_init_devtree+0xa4/0x48c
[ T0] [c000000001517f10] [c00000000113ac90] early_setup+0xc8/0x254
[ T0] [c000000001517f90] [000000000000c754] 0xc754
powerpc32,
Call Trace:
[c06bbee0] [c067e334] early_init_dt_scan_chosen+0xf8/0x1dc (unreliable)
[c06bbf10] [c0666ec4] early_init_dt_scan_chosen_ppc+0x18/0x6c
[c06bbf30] [c067e048] of_scan_flat_dt+0x98/0xf4
[c06bbf70] [c0667234] early_init_devtree+0x48/0x2d0
[c06bbfb0] [c06679cc] machine_init+0x98/0xcc
[c06bbff0] [c0000398] set_ivor+0x114/0x154
I think it would be possible to just move the generic handling entire into
architecture code.
Daniel
next prev parent reply other threads:[~2021-04-09 1:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>
2021-03-30 17:56 ` [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section Daniel Walker
2021-03-30 19:49 ` Rob Herring
2021-03-30 23:17 ` Daniel Walker
2021-04-07 22:59 ` Rob Herring
2021-04-09 1:26 ` Daniel Walker [this message]
2021-04-02 17:32 ` Christophe Leroy
2021-04-06 16:35 ` Daniel Walker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210409012657.GH3981976@zorba \
--to=danielwa@cisco.com \
--cc=akpm@linux-foundation.org \
--cc=christophe.leroy@csgroup.eu \
--cc=daniel@gimpelevich.san-francisco.ca.us \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=robh@kernel.org \
--cc=rruslich@cisco.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=xe-linux-external@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).