From: Grant Likely <grant.likely@secretlab.ca>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: devicetree-discuss@lists.ozlabs.org,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v2] of: Change logic to overwrite cmd_line with CONFIG_CMDLINE
Date: Mon, 19 Sep 2011 22:55:10 -0600 [thread overview]
Message-ID: <20110920045510.GA31886@ponder.secretlab.ca> (raw)
In-Reply-To: <1316494215.7975.29.camel@pasglop>
On Tue, Sep 20, 2011 at 02:50:15PM +1000, Benjamin Herrenschmidt wrote:
> We used to overwrite with CONFIG_CMDLINE if we found a chosen
> node but failed to get bootargs out of it or they were empty,
> unless CONFIG_CMDLINE_FORCE is set.
>
> Instead change that to overwrite if "data" is non empty after
> the bootargs check. It allows arch code to have other mechanisms
> to retrieve the command line prior to parsing the device-tree.
>
> Note: CONFIG_CMDLINE_FORCE case should ideally be handled elsewhere
> as it won't work as it-is if the device-tree has no /chosen node
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: devicetree-discuss@lists-ozlabs.org
> CC: Grant Likely <grant.likely@secretlab.ca>
Looks okay to me.
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> drivers/of/fdt.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> v2. Use "data" instead of "cmd_line" so it works on archs like
> mips who don't pass cmd_line to that function to start with, also
> add a comment explaining the mechanism.
>
> (resent with right list address as well while at it)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 65200af..323b722 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -681,9 +681,14 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> if (p != NULL && l > 0)
> strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
>
> + /*
> + * CONFIG_CMDLINE is meant to be a default in case nothing else
> + * managed to set the command line, unless CONFIG_CMDLINE_FORCE
> + * is set in which case we override whatever was found earlier.
> + */
> #ifdef CONFIG_CMDLINE
> #ifndef CONFIG_CMDLINE_FORCE
> - if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
> + if (!data[0])
> #endif
> strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
> #endif /* CONFIG_CMDLINE */
> --
> 1.7.4.1
>
>
>
>
next prev parent reply other threads:[~2011-09-20 4:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-20 4:50 [PATCH v2] of: Change logic to overwrite cmd_line with CONFIG_CMDLINE Benjamin Herrenschmidt
2011-09-20 4:55 ` Grant Likely [this message]
2012-01-07 0:48 ` Doug Anderson
2012-01-10 9:10 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2011-09-20 4:48 Benjamin Herrenschmidt
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=20110920045510.GA31886@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=benh@kernel.crashing.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/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).