Skip to contentSkip to conversation

RISC-V: Kconfig: Fix help text of CMDLINE_EXTEND

PATCH In review [email protected] 2 participants 4 messages Mar 28, 2025 – Apr 22, 2025 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISC-V: Kconfig: Fix help text of CMDLINE_EXTEND

From: 谢致邦 (XIE Zhibang) <[email protected]>

It is the built-in command line appended to the bootloader command line, not the bootloader command line appended to the built-in command line.

Fixes 3aed8c43267e ("RISC-V: Update Kconfig to better handle CMDLINE")
---
 arch/riscv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/Kconfig +2 -2
index 54ed2a8cd7af..4cd18d0d07b3 100644
@@ -1144,8 +1144,8 @@ config CMDLINE_FALLBACK
 config CMDLINE_EXTEND
 	bool "Extend bootloader kernel arguments"
 	help
-	  The command-line arguments provided during boot will be
-	  appended to the built-in command line. This is useful in
+	  The built-in command line will be appended to the command-
+	  line arguments provided during boot. This is useful in
 	  cases where the provided arguments are insufficient and
 	  you don't want to or cannot modify them.
 
Signature · 1 line
2.43.0
#1 lore raw

Hi XIE Zhibang,

Quoted 16 lines · On 28/03/2025 11:14, [email protected] wrote:

From: 谢致邦 (XIE Zhibang) <[email protected]>

It is the built-in command line appended to the bootloader command line, not the bootloader command line appended to the built-in command line.

Fixes 3aed8c43267e ("RISC-V: Update Kconfig to better handle CMDLINE")
---
  arch/riscv/Kconfig | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/Kconfig +0 -0
index 54ed2a8cd7af..4cd18d0d07b3 100644

arch/riscv/Kconfig config CMDLINE_FALLBACK · line 1151

Quoted 10 lines
arch/riscv/Kconfig +2 -2
@@ -1144,8 +1144,8 @@ config CMDLINE_FALLBACK
  config CMDLINE_EXTEND
  	bool "Extend bootloader kernel arguments"
  	help
-	  The command-line arguments provided during boot will be
-	  appended to the built-in command line. This is useful in
+	  The built-in command line will be appended to the command-
+	  line arguments provided during boot. This is useful in
  	  cases where the provided arguments are insufficient and
  	  you don't want to or cannot modify them.
 

It seems that you're correct (https://elixir.bootlin.com/linux/v6.14-rc6/source/drivers/of/fdt.c#L1065).

I noticed that all the architectures that define this config have the same text, so I guess the behavior changed at some point.

I would suggest to fix all the architectures and find which commit changed this behavior.

Thanks,

Alex

#2 lore raw

LoongArch (merged):
https://lore.kernel.org/all/[email protected]/

RISC-V:
https://lore.kernel.org/all/[email protected]/

PowerPC:
https://lore.kernel.org/all/[email protected]/

SH:
https://lore.kernel.org/all/[email protected]/

ARM (rejected):
https://lore.kernel.org/all/[email protected]/

ARM64 (rejected):
https://lore.kernel.org/all/[email protected]/

Russell King (Oracle) wrote:
"
ARM gained support for CMDLINE_EXTEND in commit 4394c1244249 ("ARM:
6893/1: Allow for kernel command line concatenation") dated 4 May 2011. In this commit, CONFIG_CMDLINE _prefixes_ the boot loader supplied arguments.

In commit 34b82026a507 ("fdt: fix extend of cmd line") dated 13 April 2016, which _post_ _dates_ the introduction on ARM, and the commit even states that it's fixing the lack of appending compared to ARM, this adds code to drivers/of to _append_ CONFIG_CMDLINE to the FDT arguments which come from the boot loader.

It is DT that implemented this wrongly.

No, we are not going to change arch/arm to conform to something that was implemented in a broken way. drivers/of needs fixing to actually implement it as it was *originally* intended - and there is five years of arch/arm doing this *before* DT started to do it.

If drivers/of maintainers also don't want to change, then I'm sorry, but you have to then put up with the fact that it got wrongly implemented by drivers/of and thus has a different behaviour there.
"

#3 lore raw

Hi,

Quoted 39 lines · On 21/04/2025 12:16, [email protected] wrote:

LoongArch (merged):
https://lore.kernel.org/all/[email protected]/

RISC-V:
https://lore.kernel.org/all/[email protected]/

PowerPC:
https://lore.kernel.org/all/[email protected]/

SH:
https://lore.kernel.org/all/[email protected]/

ARM (rejected):
https://lore.kernel.org/all/[email protected]/

ARM64 (rejected):
https://lore.kernel.org/all/[email protected]/

Russell King (Oracle) wrote:
"
ARM gained support for CMDLINE_EXTEND in commit 4394c1244249 ("ARM:
6893/1: Allow for kernel command line concatenation") dated 4 May 2011. In this commit, CONFIG_CMDLINE _prefixes_ the boot loader supplied arguments.

In commit 34b82026a507 ("fdt: fix extend of cmd line") dated 13 April 2016, which _post_ _dates_ the introduction on ARM, and the commit even states that it's fixing the lack of appending compared to ARM, this adds code to drivers/of to _append_ CONFIG_CMDLINE to the FDT arguments which come from the boot loader.

It is DT that implemented this wrongly.

No, we are not going to change arch/arm to conform to something that was implemented in a broken way. drivers/of needs fixing to actually implement it as it was *originally* intended - and there is five years of arch/arm doing this *before* DT started to do it.

Quoted 5 lines

If drivers/of maintainers also don't want to change, then I'm sorry, but you have to then put up with the fact that it got wrongly implemented by drivers/of and thus has a different behaviour there.
"

Thanks for the follow-up.

Since riscv always had the behaviour you describe in your patch, I'll take your patch.

Thanks,

Alex

Quoted 5 lines

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv