All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Fix missing arcs_cmdline
@ 2018-03-16  2:59 Jaedon Shin
  2018-03-16 12:43 ` Mathieu Malaterre
  0 siblings, 1 reply; 3+ messages in thread
From: Jaedon Shin @ 2018-03-16  2:59 UTC (permalink / raw)
  To: Ralf Baechle, James Hogan, Paul Burton
  Cc: Mathieu Malaterre, linux-mips, Jaedon Shin

Due to commit 8ce355cf2e38 ("MIPS: Setup boot_command_line before
plat_mem_setup"), the value of arcs_command by prom_init is removed.
boot_command_line is initialized with __dt_setup_arch from
plat_mem_setup, but arcs_command is copied to boot_command_line before
plat_mem_setup by previous commit. This commit recover missing
arcs_command by prom_init.

Fixes: 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup")
Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 arch/mips/kernel/setup.c | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 5f8b0a9e30b3..e87f468f76dc 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -836,30 +836,12 @@ static void __init arch_mem_init(char **cmdline_p)
 
 #if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE)
 	strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
-#else
-	if ((USE_PROM_CMDLINE && arcs_cmdline[0]) ||
-	    (USE_DTB_CMDLINE && !boot_command_line[0]))
-		strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
-
-	if (EXTEND_WITH_PROM && arcs_cmdline[0]) {
-		if (boot_command_line[0])
-			strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
-		strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
-	}
-
-#if defined(CONFIG_CMDLINE_BOOL)
+#elif defined(CONFIG_CMDLINE_BOOL)
 	if (builtin_cmdline[0]) {
 		if (boot_command_line[0])
 			strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
 		strlcat(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
 	}
-
-	if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) {
-		if (boot_command_line[0])
-			strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
-		strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
-	}
-#endif
 #endif
 
 	/* call board setup routine */
@@ -881,6 +863,22 @@ static void __init arch_mem_init(char **cmdline_p)
 	pr_info("Determined physical RAM map:\n");
 	print_memory_map();
 
+	if ((USE_PROM_CMDLINE && arcs_cmdline[0]) ||
+	    (USE_DTB_CMDLINE && !boot_command_line[0]))
+		strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
+
+	if (EXTEND_WITH_PROM && arcs_cmdline[0]) {
+		if (boot_command_line[0])
+			strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+		strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
+	}
+
+	if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) {
+		if (boot_command_line[0])
+			strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+		strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
+	}
+
 	strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
 
 	*cmdline_p = command_line;
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Fix missing arcs_cmdline
  2018-03-16  2:59 [PATCH] MIPS: Fix missing arcs_cmdline Jaedon Shin
@ 2018-03-16 12:43 ` Mathieu Malaterre
  2018-03-19  5:53   ` Jaedon Shin
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Malaterre @ 2018-03-16 12:43 UTC (permalink / raw)
  To: Jaedon Shin; +Cc: Ralf Baechle, James Hogan, Paul Burton, Linux-MIPS

Jaedon,

On Fri, Mar 16, 2018 at 3:59 AM, Jaedon Shin <jaedon.shin@gmail.com> wrote:
> Due to commit 8ce355cf2e38 ("MIPS: Setup boot_command_line before
> plat_mem_setup"), the value of arcs_command by prom_init is removed.
> boot_command_line is initialized with __dt_setup_arch from
> plat_mem_setup, but arcs_command is copied to boot_command_line before
> plat_mem_setup by previous commit. This commit recover missing
> arcs_command by prom_init.

If I cherry-pick your commit into my local branch I can no longer boot
my MIPS Creator CI20. The sad part is that nothing shows up in the log
(screen + tty) to indicate what the issue might be.

> Fixes: 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup")
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
>  arch/mips/kernel/setup.c | 36 +++++++++++++++++-------------------
>  1 file changed, 17 insertions(+), 19 deletions(-)
>
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index 5f8b0a9e30b3..e87f468f76dc 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -836,30 +836,12 @@ static void __init arch_mem_init(char **cmdline_p)
>
>  #if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE)
>         strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
> -#else
> -       if ((USE_PROM_CMDLINE && arcs_cmdline[0]) ||
> -           (USE_DTB_CMDLINE && !boot_command_line[0]))
> -               strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
> -
> -       if (EXTEND_WITH_PROM && arcs_cmdline[0]) {
> -               if (boot_command_line[0])
> -                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
> -               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
> -       }
> -
> -#if defined(CONFIG_CMDLINE_BOOL)
> +#elif defined(CONFIG_CMDLINE_BOOL)
>         if (builtin_cmdline[0]) {
>                 if (boot_command_line[0])
>                         strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
>                 strlcat(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>         }
> -
> -       if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) {
> -               if (boot_command_line[0])
> -                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
> -               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
> -       }
> -#endif
>  #endif
>
>         /* call board setup routine */
> @@ -881,6 +863,22 @@ static void __init arch_mem_init(char **cmdline_p)
>         pr_info("Determined physical RAM map:\n");
>         print_memory_map();
>
> +       if ((USE_PROM_CMDLINE && arcs_cmdline[0]) ||
> +           (USE_DTB_CMDLINE && !boot_command_line[0]))
> +               strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
> +
> +       if (EXTEND_WITH_PROM && arcs_cmdline[0]) {
> +               if (boot_command_line[0])
> +                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
> +               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
> +       }
> +
> +       if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) {
> +               if (boot_command_line[0])
> +                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
> +               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
> +       }
> +
>         strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
>
>         *cmdline_p = command_line;
> --
> 2.16.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Fix missing arcs_cmdline
  2018-03-16 12:43 ` Mathieu Malaterre
@ 2018-03-19  5:53   ` Jaedon Shin
  0 siblings, 0 replies; 3+ messages in thread
From: Jaedon Shin @ 2018-03-19  5:53 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: Ralf Baechle, James Hogan, Paul Burton, Linux-MIPS

Mathieu,

> On 16 Mar 2018, at 9:43 PM, Mathieu Malaterre <malat@debian.org> wrote:
> 
> Jaedon,
> 
> On Fri, Mar 16, 2018 at 3:59 AM, Jaedon Shin <jaedon.shin@gmail.com> wrote:
>> Due to commit 8ce355cf2e38 ("MIPS: Setup boot_command_line before
>> plat_mem_setup"), the value of arcs_command by prom_init is removed.
>> boot_command_line is initialized with __dt_setup_arch from
>> plat_mem_setup, but arcs_command is copied to boot_command_line before
>> plat_mem_setup by previous commit. This commit recover missing
>> arcs_command by prom_init.
> 
> If I cherry-pick your commit into my local branch I can no longer boot
> my MIPS Creator CI20. The sad part is that nothing shows up in the log
> (screen + tty) to indicate what the issue might be.

Did it work before this patch was cherry-picked?
But I find this patch has problem that didn't work CONFIG_CMDLINE with
__dt_setup_arch.

I have problem that bootloader argument (applied in prom_init) are removed.
Other MIPS_CMDLINE_* options may have also.

The previous patch 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup")
fixes only duplicating in NO bootargs and CONFIG_CMDLINE. It cause problems
MIPS_CMDLINE_* options and CONFIG_CMDLINE_{BOOL,OVERRIDE}+__dt_setup_arch.
So we'll have to revert it and change the CONFIG_CMDLINE_{BOOL,OVERRIDE}
or append the CONFIG_CMDLINE_{BOOL,OVERRIDE} to fdt.c.

Thanks,
Jaedon

> 
>> Fixes: 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup")
>> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
>> ---
>> arch/mips/kernel/setup.c | 36 +++++++++++++++++-------------------
>> 1 file changed, 17 insertions(+), 19 deletions(-)
>> 
>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>> index 5f8b0a9e30b3..e87f468f76dc 100644
>> --- a/arch/mips/kernel/setup.c
>> +++ b/arch/mips/kernel/setup.c
>> @@ -836,30 +836,12 @@ static void __init arch_mem_init(char **cmdline_p)
>> 
>> #if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE)
>>        strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>> -#else
>> -       if ((USE_PROM_CMDLINE && arcs_cmdline[0]) ||
>> -           (USE_DTB_CMDLINE && !boot_command_line[0]))
>> -               strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>> -
>> -       if (EXTEND_WITH_PROM && arcs_cmdline[0]) {
>> -               if (boot_command_line[0])
>> -                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
>> -               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>> -       }
>> -
>> -#if defined(CONFIG_CMDLINE_BOOL)
>> +#elif defined(CONFIG_CMDLINE_BOOL)
>>        if (builtin_cmdline[0]) {
>>                if (boot_command_line[0])
>>                        strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
>>                strlcat(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>>        }
>> -
>> -       if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) {
>> -               if (boot_command_line[0])
>> -                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
>> -               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>> -       }
>> -#endif
>> #endif
>> 
>>        /* call board setup routine */
>> @@ -881,6 +863,22 @@ static void __init arch_mem_init(char **cmdline_p)
>>        pr_info("Determined physical RAM map:\n");
>>        print_memory_map();
>> 
>> +       if ((USE_PROM_CMDLINE && arcs_cmdline[0]) ||
>> +           (USE_DTB_CMDLINE && !boot_command_line[0]))
>> +               strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>> +
>> +       if (EXTEND_WITH_PROM && arcs_cmdline[0]) {
>> +               if (boot_command_line[0])
>> +                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
>> +               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>> +       }
>> +
>> +       if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) {
>> +               if (boot_command_line[0])
>> +                       strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
>> +               strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
>> +       }
>> +
>>        strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
>> 
>>        *cmdline_p = command_line;
>> --
>> 2.16.2
>> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-19  5:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16  2:59 [PATCH] MIPS: Fix missing arcs_cmdline Jaedon Shin
2018-03-16 12:43 ` Mathieu Malaterre
2018-03-19  5:53   ` Jaedon Shin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.