[PATCH 0/2] printk/console: Use ttynull when no console is available or wanted

From: Petr Mladek
Date: Wed Nov 11 2020 - 08:55:52 EST


This is another attempt to solve regression caused by the commit
48021f98130880dd74 ("printk: handle blank console arguments passed in.").

It prevented a crash caused by empty console= parameter. But it caused
performance problems on Chromebooks because they use it to disable
all consoles, see
see https://lore.kernel.org/r/20201006025935.GA597@jagdpanzerIV.localdomain

Solve both problems by using ttynull console driver that was crated
exactly for this purpose.

The 1st patch should prevent the crash for any invalid console name.

The 2nd patch allows to used the ttynull driver also with the widely
used console= and console=null parameters.

Best Regards,
Petr

Petr Mladek (2):
init/console: Use ttynull as a fallback when there is no console
printk/console: Allow to disable console output by using console="" or
console=null

drivers/tty/Kconfig | 14 --------------
drivers/tty/Makefile | 3 +--
drivers/tty/ttynull.c | 18 ++++++++++++++++++
include/linux/console.h | 3 +++
init/main.c | 10 ++++++++--
kernel/printk/printk.c | 9 ++++++++-
6 files changed, 38 insertions(+), 19 deletions(-)

--
2.26.2