LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Amos Waterland <apw@us.ibm.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] Fix builtin command line interaction with firmware
Date: Tue, 13 Jun 2006 12:45:24 +0200	[thread overview]
Message-ID: <112BBF31-FF58-4435-8767-B398C285B9CD@kernel.crashing.org> (raw)
In-Reply-To: <20060613034502.GA15130@kvasir.watson.ibm.com>

> It seems that prom_init's early_cmdline_parse is broken on at least
> Apple 970 xserves and IBM JS20 blades with SLOF.  The firmware of  
> these
> machines returns -1 and 1 respectively when getprop is called for the
> bootargs property of /chosen, causing Linux to ignore its builtin
> command line in favor of a null string.  This patch makes Linux use  
> its
> builtin command line if getprop returns an error or a null string.

If the user gave no boot arguments on the boot command, -1 and 1
are the only two valid return values even, and -1 is only valid
if no "boot" or "load" command was used to load the kernel.
Makes me wonder what those XServe's do ;-)

(0 isn't valid as the property is encoded with encode-string, which
puts a trailing 0 byte on the empty string.  Doesn't hurt to check
for it anyway of course ;-) ).

> Signed-off-by: Amos Waterland <apw@us.ibm.com>

Looks good, thanks!

Acked-by: Segher Boessenkool <segher@kernel.crashing.org>


>
> ---
>
>  arch/powerpc/kernel/prom_init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> 0f0caf0342f39b4437dcb3e9f2f1d62bfb4e3e7d
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/ 
> prom_init.c
> index f70bd09..2e63a90 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -574,7 +574,7 @@ static void __init early_cmdline_parse(v
>  	if ((long)_prom->chosen > 0)
>  		l = prom_getprop(_prom->chosen, "bootargs", p,  
> COMMAND_LINE_SIZE-1);
>  #ifdef CONFIG_CMDLINE
> -	if (l == 0) /* dbl check */
> +	if (l <= 0 || p[0] == '\0') /* dbl check */
>  		strlcpy(RELOC(prom_cmd_line),
>  			RELOC(CONFIG_CMDLINE), sizeof(prom_cmd_line));
>  #endif /* CONFIG_CMDLINE */
> -- 
> 1.0.4
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

      reply	other threads:[~2006-06-13 10:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13  3:45 [PATCH] Fix builtin command line interaction with firmware Amos Waterland
2006-06-13 10:45 ` Segher Boessenkool [this message]

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=112BBF31-FF58-4435-8767-B398C285B9CD@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=apw@us.ibm.com \
    --cc=linuxppc-dev@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