Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

5 messages, 4 authors, 2021-04-02 · open the first message on its own page

Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

From: Andreas Schwab <hidden>
Date: 2021-03-26 14:09:34

On Mär 26 2021, Christophe Leroy wrote:
quoted hunk
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index f8f15332caa2..e7c91ee478d1 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -20,6 +20,7 @@
 #include <linux/swiotlb.h>
 #include <linux/smp.h>
 #include <linux/efi.h>
+#include <linux/cmdline.h>
 
 #include <asm/cpu_ops.h>
 #include <asm/early_ioremap.h>
@@ -228,10 +229,8 @@ static void __init parse_dtb(void)
 	}
 
 	pr_err("No DTB passed to the kernel\n");
-#ifdef CONFIG_CMDLINE_FORCE
-	strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+	cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
 	pr_info("Forcing kernel command line to: %s\n", boot_command_line);
Shouldn't that message become conditional in some way?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

From: Christophe Leroy <hidden>
Date: 2021-03-26 14:21:24


Le 26/03/2021 à 15:08, Andreas Schwab a écrit :
On Mär 26 2021, Christophe Leroy wrote:
quoted
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index f8f15332caa2..e7c91ee478d1 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -20,6 +20,7 @@
  #include <linux/swiotlb.h>
  #include <linux/smp.h>
  #include <linux/efi.h>
+#include <linux/cmdline.h>
  
  #include <asm/cpu_ops.h>
  #include <asm/early_ioremap.h>
@@ -228,10 +229,8 @@ static void __init parse_dtb(void)
  	}
  
  	pr_err("No DTB passed to the kernel\n");
-#ifdef CONFIG_CMDLINE_FORCE
-	strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+	cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
  	pr_info("Forcing kernel command line to: %s\n", boot_command_line);
Shouldn't that message become conditional in some way?
You are right, I did something similar on ARM but looks like I missed it on RISCV.

Christophe

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

From: Rob Herring <robh@kernel.org>
Date: 2021-03-26 15:27:44

On Fri, Mar 26, 2021 at 8:20 AM Christophe Leroy
[off-list ref] wrote:


Le 26/03/2021 à 15:08, Andreas Schwab a écrit :
quoted
On Mär 26 2021, Christophe Leroy wrote:
quoted
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index f8f15332caa2..e7c91ee478d1 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -20,6 +20,7 @@
  #include <linux/swiotlb.h>
  #include <linux/smp.h>
  #include <linux/efi.h>
+#include <linux/cmdline.h>

  #include <asm/cpu_ops.h>
  #include <asm/early_ioremap.h>
@@ -228,10 +229,8 @@ static void __init parse_dtb(void)
     }

     pr_err("No DTB passed to the kernel\n");
-#ifdef CONFIG_CMDLINE_FORCE
-    strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+    cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
     pr_info("Forcing kernel command line to: %s\n", boot_command_line);
Shouldn't that message become conditional in some way?
You are right, I did something similar on ARM but looks like I missed it on RISCV.
How is this hunk even useful? Under what conditions can you boot
without a DTB? Even with a built-in DTB, the DT cmdline handling would
be called.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

From: Nick Kossifidis <hidden>
Date: 2021-03-30 01:11:42

Στις 2021-03-26 17:26, Rob Herring έγραψε:
On Fri, Mar 26, 2021 at 8:20 AM Christophe Leroy
[off-list ref] wrote:
quoted


Le 26/03/2021 à 15:08, Andreas Schwab a écrit :
quoted
On Mär 26 2021, Christophe Leroy wrote:
quoted
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index f8f15332caa2..e7c91ee478d1 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -20,6 +20,7 @@
  #include <linux/swiotlb.h>
  #include <linux/smp.h>
  #include <linux/efi.h>
+#include <linux/cmdline.h>

  #include <asm/cpu_ops.h>
  #include <asm/early_ioremap.h>
@@ -228,10 +229,8 @@ static void __init parse_dtb(void)
     }

     pr_err("No DTB passed to the kernel\n");
-#ifdef CONFIG_CMDLINE_FORCE
-    strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+    cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
     pr_info("Forcing kernel command line to: %s\n", boot_command_line);
Shouldn't that message become conditional in some way?
You are right, I did something similar on ARM but looks like I missed 
it on RISCV.
How is this hunk even useful? Under what conditions can you boot
without a DTB? Even with a built-in DTB, the DT cmdline handling would
be called.

Rob
cced Paul who introduced this:
https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/arch/riscv/kernel/setup.c?id=8fd6e05c7463b635e51ec7df0a1858c1b5a6e350


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

From: Christophe Leroy <hidden>
Date: 2021-04-02 15:21:55


Le 26/03/2021 à 16:26, Rob Herring a écrit :
On Fri, Mar 26, 2021 at 8:20 AM Christophe Leroy
[off-list ref] wrote:
quoted


Le 26/03/2021 à 15:08, Andreas Schwab a écrit :
quoted
On Mär 26 2021, Christophe Leroy wrote:
quoted
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index f8f15332caa2..e7c91ee478d1 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -20,6 +20,7 @@
   #include <linux/swiotlb.h>
   #include <linux/smp.h>
   #include <linux/efi.h>
+#include <linux/cmdline.h>

   #include <asm/cpu_ops.h>
   #include <asm/early_ioremap.h>
@@ -228,10 +229,8 @@ static void __init parse_dtb(void)
      }

      pr_err("No DTB passed to the kernel\n");
-#ifdef CONFIG_CMDLINE_FORCE
-    strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+    cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
      pr_info("Forcing kernel command line to: %s\n", boot_command_line);
Shouldn't that message become conditional in some way?
You are right, I did something similar on ARM but looks like I missed it on RISCV.
How is this hunk even useful? Under what conditions can you boot
without a DTB? Even with a built-in DTB, the DT cmdline handling would
be called.
Don't know, I wanted to keep as is today.

Do you think the hunk should be completely removed ?


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help