From 01e249da0a52f0289959b11f8c02901e8ff6c93a 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 0aa4a9c110ac..4d62442e4419 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -61,7 +61,7 @@ CONFIG_CP15_BARRIER_EMULATION=y CONFIG_SETEND_EMULATION=y CONFIG_RANDOMIZE_BASE=y # CONFIG_RANDOMIZE_MODULE_REGION_FULL is not set -CONFIG_CMDLINE="stack_depot_disable=on kasan.stacktrace=off kvm-arm.mode=protected cgroup_disable=pressure" +CONFIG_CMDLINE="console=ttynull stack_depot_disable=on cgroup_disable=pressure kasan.stacktrace=off kvm-arm.mode=protected" # CONFIG_DMI is not set CONFIG_PM_WAKELOCKS=y CONFIG_PM_WAKELOCKS_LIMIT=0 @@ -379,6 +379,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 43e1fb51dcf2..09fa20280daa 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -59,7 +59,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 @@ -346,6 +346,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