From 0778b7e91cd26987dc3cbfbfbeeae884036a4194 Mon Sep 17 00:00:00 2001 From: Carlos Llamas Date: Sun, 19 Sep 2021 01:30:28 +0000 Subject: [PATCH] ANDROID: Revert "arm64: Drop support for CMDLINE_EXTEND" This reverts commit cae118b6acc309539b33339e846cbb19187c164c. Upstream removed the support for CMDLINE_EXTEND on arm64 due to some inconsistencies in the way command-line was assembled together. However, the patch inadvertently deleted same config option from the android tree which was first introduced by commit 056f12819b75 ("ANDROID: arm64: copy CONFIG_CMDLINE_EXTEND from ARM") back in 2014. Upstream is currently working on a solution to fix the divergence by allowing prepend and append functionalities. While we wait for the new series to land let's bring back CMDLINE_EXTEND option for android, so arm64 can actually use of the functionality provided by d9a2a3f2c2c4 ("ANDROID: of: Support CONFIG_CMDLINE_EXTEND config option"). Bug: 120440972 Bug: 261894961 Change-Id: I3b7fd55e95af49b64f284582dee40392074d32f1 Signed-off-by: Carlos Llamas Signed-off-by: Elliot Berman --- arch/arm64/Kconfig | 6 ++++++ arch/arm64/kernel/idreg-override.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1489ef400c6a..1478a5393b36 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2195,6 +2195,12 @@ config CMDLINE_FROM_BOOTLOADER the boot loader doesn't provide any, the default kernel command string provided in CMDLINE will be used. +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. + config CMDLINE_FORCE bool "Always use the default kernel command string" help diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index 95133765ed29..1af3ac47faa0 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -287,8 +287,11 @@ static __init void parse_cmdline(void) { const u8 *prop = get_bootargs_cmdline(); - if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop) + if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || + IS_ENABLED(CONFIG_CMDLINE_FORCE) || + !prop) { __parse_cmdline(CONFIG_CMDLINE, true); + } if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop) __parse_cmdline(prop, true);