linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: Fix support for CMDLINE_EXTEND
@ 2025-03-28 10:20 Yeking
  2025-03-28 12:29 ` Russell King (Oracle)
  0 siblings, 1 reply; 6+ messages in thread
From: Yeking @ 2025-03-28 10:20 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: 谢致邦 (XIE Zhibang), Russell King,
	Russell King (Oracle), Linus Walleij, Ard Biesheuvel,
	Eric Biggers, Yuntao Liu, Jinjie Ruan, Dmitry Baryshkov,
	Masahiro Yamada, Dave Vasilevsky, Nathan Chancellor,
	Victor Boivie, Nicolas Pitre, Oskar Andero, Bjorn Andersson,
	linux-kernel

From: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>

It should be the default command line appended to the bootloader command
line, not the bootloader command line appended to the default command
line.

This will be consistent with the behavior of FDT, EFI, and other
platforms.

Fixes: 4394c1244249 ("ARM: 6893/1: Allow for kernel command line concatenation")
Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>
---
 arch/arm/Kconfig              |  4 ++--
 arch/arm/kernel/atags_parse.c | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 25ed6f1a7c7a..635e4da33fff 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1534,8 +1534,8 @@ config CMDLINE_FROM_BOOTLOADER
 config CMDLINE_EXTEND
 	bool "Extend bootloader kernel arguments"
 	help
-	  The command-line arguments provided by the boot loader will be
-	  appended to the default kernel command string.
+	  The default kernel command string will be appended to the
+	  command-line arguments provided by the boot loader.
 
 config CMDLINE_FORCE
 	bool "Always use the default kernel command string"
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
index 4ec591bde3df..bd163f00602e 100644
--- a/arch/arm/kernel/atags_parse.c
+++ b/arch/arm/kernel/atags_parse.c
@@ -120,15 +120,15 @@ __tagtable(ATAG_REVISION, parse_tag_revision);
 
 static int __init parse_tag_cmdline(const struct tag *tag)
 {
-#if defined(CONFIG_CMDLINE_EXTEND)
-	strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
-	strlcat(default_command_line, tag->u.cmdline.cmdline,
-		COMMAND_LINE_SIZE);
-#elif defined(CONFIG_CMDLINE_FORCE)
+#if defined(CONFIG_CMDLINE_FORCE)
 	pr_warn("Ignoring tag cmdline (using the default kernel command line)\n");
 #else
 	strscpy(default_command_line, tag->u.cmdline.cmdline,
 		COMMAND_LINE_SIZE);
+#if defined(CONFIG_CMDLINE_EXTEND)
+	strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
+	strlcat(default_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
 #endif
 	return 0;
 }
-- 
2.43.0



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

end of thread, other threads:[~2025-03-31 15:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28 10:20 [PATCH] ARM: Fix support for CMDLINE_EXTEND Yeking
2025-03-28 12:29 ` Russell King (Oracle)
     [not found]   ` <tencent_F967B6C3FF5405F2D17EF660590BFD213C0A@qq.com>
2025-03-31 12:55     ` Russell King (Oracle)
2025-03-31 13:34       ` Russell King (Oracle)
2025-03-31 15:14         ` Maxim Uvarov
2025-03-31 15:18           ` Russell King (Oracle)

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).