From f3fcce16af007e77e8d9c7bffa1314cac155a77d Mon Sep 17 00:00:00 2001 From: Alistair Delva Date: Mon, 14 Mar 2022 16:20:48 -0700 Subject: [PATCH] ANDROID: GKI: Enable CONFIG_NULL_TTY by default Because GKI has various serial drivers built in (8250, pl031, samsung, sprd, geni) for earlycon, if they succeed probes for full functionality, (such as if they are specified in DT as UART devices), the kernel would unconditionally set up the first console device as the default console, which is not generally desirable for production. Enable CONFIG_NULL_TTY and enable "console=ttynull" by default. This causes the kernel to always be silent unless a kernel console device is explicitly specified on the cmdline. This has no effect on earlycon "boot console" devices, just normal "console" devices. Bug: 223797063 Change-Id: Id4cd0615bad79462f39397427380302b1904e42b Signed-off-by: Alistair Delva --- arch/arm64/configs/gki_defconfig | 3 ++- arch/x86/configs/gki_defconfig | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index 172d02dc153c..4f417c2a4194 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -64,7 +64,7 @@ CONFIG_SETEND_EMULATION=y CONFIG_ARM64_MPAM=y CONFIG_RANDOMIZE_BASE=y # CONFIG_RANDOMIZE_MODULE_REGION_FULL is not set -CONFIG_CMDLINE="stack_depot_disable=on kasan.stacktrace=off cgroup_disable=pressure" +CONFIG_CMDLINE="console=ttynull stack_depot_disable=on cgroup_disable=pressure kasan.stacktrace=off" CONFIG_CMDLINE_EXTEND=y # CONFIG_DMI is not set CONFIG_PM_WAKELOCKS=y @@ -383,6 +383,7 @@ CONFIG_SERIAL_QCOM_GENI=y CONFIG_SERIAL_QCOM_GENI_CONSOLE=y CONFIG_SERIAL_SPRD=y CONFIG_SERIAL_SPRD_CONSOLE=y +CONFIG_NULL_TTY=y CONFIG_HVC_DCC=y CONFIG_SERIAL_DEV_BUS=y CONFIG_HW_RANDOM=y diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 5b72fdac3cd4..eeb0bf48890b 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -60,7 +60,7 @@ CONFIG_NR_CPUS=32 # CONFIG_X86_MCE is not set CONFIG_EFI=y CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="stack_depot_disable=on cgroup_disable=pressure" +CONFIG_CMDLINE="console=ttynull stack_depot_disable=on cgroup_disable=pressure" CONFIG_PM_WAKELOCKS=y CONFIG_PM_WAKELOCKS_LIMIT=0 # CONFIG_PM_WAKELOCKS_GC is not set @@ -345,6 +345,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=0 CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_SAMSUNG=y CONFIG_SERIAL_SAMSUNG_CONSOLE=y +CONFIG_NULL_TTY=y CONFIG_SERIAL_DEV_BUS=y CONFIG_HW_RANDOM=y # CONFIG_DEVMEM is not set