linux/drivers
Petr Mladek aff56c67b0 FROMLIST: Revert "init/console: Use ttynull as a fallback when there is no console"
This reverts commit 757055ae8d.

The commit caused that ttynull was used as the default console
on many systems. It happened when there was no console configured
on the command line and ttynull_init() was the first initcall
calling register_console().

The commit fixed a historical problem that have been there for ages.
The primary motivation was the commit 3cffa06aee
("printk/console: Allow to disable console output by using console=""
or console=null"). It provided a clean solution
for a workaround that was widely used and worked only by chance.

This revert causes that the console="" or console=null command line
options will again work only by chance. These options will cause that
a particular console will be preferred and the default (tty) ones
will not get enabled. There will be no console registered at
all. As a result there won't be stdin, stdout, and stderr for
the init process. But it worked exactly this way even before.

The proper solution has to fulfill many conditions:

  + Register ttynull only when explicitly required or as
    the ultimate fallback.

  + ttynull must get associated with /dev/console but it must
    not become preferred console when used as a fallback.
    Especially, it must still be possible to replace it
    by a better console later.

Such a change requires clean up of the register_console() code.
Otherwise, it would be even harder to follow. Especially, the use
of has_preferred_console and CON_CONSDEV flag is tricky. The clean
up is risky. The ordering of consoles is not well defined. And
any changes tend to break existing user settings.

Do the revert at the least risky solution for now.

Fixes: 757055ae8d ("init/console: Use ttynull as a fallback when there is no console")
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210107164400.17904-2-pmladek@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I839b9bd17c7280b538f04de8d6b08885bb5d6585
2021-01-07 19:45:13 +01:00
..
accessibility speakup: fix uninitialized flush_lock 2020-12-09 15:38:13 +01:00
acpi ACPI updates for 5.11-rc1 2020-12-15 16:39:06 -08:00
amba
android ANDROID: vendor_hook: modify cpuidle vendor hook 2021-01-06 17:24:18 +00:00
ata
atm
auxdisplay
base Merge b4ec805464 ("Merge tag 'pm-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline 2020-12-18 15:32:45 +01:00
bcma
block Merge e37b12e4bb ("Merge tag 'for-linus-5.11-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux") into android-mainline 2021-01-06 18:34:38 +01:00
bluetooth
bus ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
cdrom cdrom: Reset sector_size back it is not 2048. 2020-12-12 11:12:25 -07:00
char UPSTREAM: um: random: Register random as hwrng-core device 2020-12-23 10:59:35 +01:00
clk Merge 8653b778e4 ("Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux") into android-mainline 2021-01-07 09:18:39 +01:00
clocksource Merge 7a932e5702 ("Merge tag 'asm-generic-timers-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic") into android-mainline 2020-12-19 14:38:32 +01:00
connector net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
counter
cpufreq Merge b4ec805464 ("Merge tag 'pm-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline 2020-12-18 15:32:45 +01:00
cpuidle ANDROID: vendor_hook: modify cpuidle vendor hook 2021-01-06 17:24:18 +00:00
crypto Networking updates for 5.11 2020-12-15 13:22:29 -08:00
dax vm_ops: rename .split() callback to .may_split() 2020-12-15 12:13:41 -08:00
dca
devfreq Merge branches 'pm-devfreq' and 'pm-tools' 2020-12-15 15:27:16 +01:00
dio
dma dmaengine updates for v5.11-rc1 2020-12-17 12:52:23 -08:00
dma-buf Merge a0b9631487 ("Merge tag 'xfs-5.11-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux") into android-mainline 2021-01-06 09:28:07 +01:00
edac Merge branch 'akpm' (patches from Andrew) 2020-12-15 12:53:37 -08:00
eisa
extcon extcon: max77693: Fix modalias string 2020-12-11 17:18:10 +09:00
firewire
firmware Merge e37b12e4bb ("Merge tag 'for-linus-5.11-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux") into android-mainline 2021-01-06 18:34:38 +01:00
fpga
fsi hwmon patches for v5.11 2020-12-15 16:06:14 -08:00
gnss
gpio This is the bulk of the GPIO changes for the v5.11 kernel cycle: 2020-12-17 18:07:20 -08:00
gpu Merge a0b9631487 ("Merge tag 'xfs-5.11-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux") into android-mainline 2021-01-06 09:28:07 +01:00
greybus
hid Merge 9805529ec5 ("Merge tag 'arm-soc-dt-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc") into android-mainline 2020-12-21 09:39:37 +01:00
hsi
hv hyperv-next for 5.11 2020-12-16 11:49:46 -08:00
hwmon ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
hwspinlock hwspinlock: sirf: Remove the redundant 'of_match_ptr' 2020-12-10 13:34:40 -06:00
hwtracing Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
i2c Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
i3c i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning 2020-12-17 10:31:30 +01:00
ide for-5.11/block-2020-12-14 2020-12-16 12:57:51 -08:00
idle
iio Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00
infiniband RDMA 5.11 pull request 2020-12-16 13:42:26 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-12-15 16:18:23 -08:00
interconnect ARM: device tree updates for 5.11 2020-12-16 16:27:35 -08:00
iommu Merge 19778dd504 ("Merge tag 'iommu-updates-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux") into android-mainline 2020-12-20 17:17:58 +01:00
ipack
irqchip Merge e37b12e4bb ("Merge tag 'for-linus-5.11-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux") into android-mainline 2021-01-06 18:34:38 +01:00
isdn
leds
lightnvm
macintosh
mailbox mailbox: arm_mhuv2: Add driver 2020-12-09 19:26:02 -06:00
mcb
md Merge 69f637c335 ("Merge tag 'for-5.11/drivers-2020-12-14' of git://git.kernel.dk/linux-block") into android-mainline 2020-12-19 16:06:54 +01:00
media Merge ff49c86f27 ("Merge tag 'f2fs-for-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs") into android-mainline 2020-12-21 09:54:59 +01:00
memory
memstick
message SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
mfd RTC for 5.11 2020-12-20 10:12:06 -08:00
misc Merge 8a5be36b93 ("Merge tag 'powerpc-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux") into android-mainline 2020-12-21 15:35:07 +01:00
mmc Merge ce51c2b7ce ("Merge tag 'mmc-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc") into android-mainline 2020-12-18 15:11:42 +01:00
most
mtd This pull request contains changes for JFFS2, UBI and UBIFS: 2020-12-17 17:46:34 -08:00
mux
net Merge d64c6f96ba ("Merge tag 'net-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") into android-mainline 2020-12-21 15:37:08 +01:00
nfc nfc: s3fwrn5: Remove unused NCI prop commands 2020-12-16 13:09:35 -08:00
ntb
nubus
nvdimm
nvme RDMA 5.11 pull request 2020-12-16 13:42:26 -08:00
nvmem
of Merge 7240153a9b ("Merge tag 'driver-core-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core") into android-mainline 2020-12-17 12:16:57 +01:00
opp Merge branch 'pm-cpufreq' 2020-12-15 15:24:52 +01:00
oprofile
parisc
parport
pci Merge 009bd55dfc ("Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma") into android-mainline 2020-12-19 16:07:13 +01:00
pcmcia Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux 2020-12-19 12:50:10 -08:00
perf perf/imx_ddr: Add system PMU identifier for userspace 2020-12-09 14:14:02 +00:00
phy Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
pinctrl Merge 3db1a3fa98 ("Merge tag 'staging-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging") into android-mainline 2020-12-17 19:17:54 +01:00
platform Merge tag 'thermal-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux 2020-12-15 16:21:37 -08:00
pnp
power Merge e37b12e4bb ("Merge tag 'for-linus-5.11-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux") into android-mainline 2021-01-06 18:34:38 +01:00
powercap Merge branches 'pm-sleep', 'pm-acpi', 'pm-domains' and 'powercap' 2020-12-15 15:26:14 +01:00
pps
ps3 powerpc/ps3: use dma_mapping_error() 2020-12-15 22:50:12 +11:00
ptp ptp: clockmatrix: deprecate firmware older than 4.8.7 2020-12-09 15:00:55 -08:00
pwm Merge e37b12e4bb ("Merge tag 'for-linus-5.11-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux") into android-mainline 2021-01-06 18:34:38 +01:00
rapidio rapidio: remove unused rio_get_asm() and rio_get_device() 2020-12-15 22:46:18 -08:00
ras
regulator Merge remote-tracking branch 'regulator/for-5.11' into regulator-next 2020-12-11 17:48:32 +00:00
remoteproc ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
reset ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
rpmsg Merge 9867cb1fd5 ("Merge tag 'jfs-5.11' of git://github.com/kleikamp/linux-shaggy") into android-mainline 2020-12-18 17:01:19 +01:00
rtc RTC for 5.11 2020-12-20 10:12:06 -08:00
s390 - Always initialize kernel stack backchain when entering the kernel, so 2020-12-18 11:08:06 -08:00
sbus
scsi Merge 8a5be36b93 ("Merge tag 'powerpc-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux") into android-mainline 2020-12-21 15:35:07 +01:00
sfi
sh
siox siox: Make remove callback return void 2020-12-10 16:17:15 +01:00
slimbus slimbus: qcom: fix potential NULL dereference in qcom_slim_prg_slew() 2020-12-10 16:23:56 +01:00
soc Merge b4ec805464 ("Merge tag 'pm-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline 2020-12-18 15:32:45 +01:00
soundwire
spi Merge 605ea5aafe ("Merge tag 'spi-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi") into android-mainline 2020-12-18 15:09:55 +01:00
spmi spmi: Add driver shutdown support 2020-12-10 10:45:36 +01:00
ssb
staging UAPI Changes: 2020-12-18 12:38:28 -08:00
target SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
tc
tee ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
thermal - Add Alder Lake support ACPI ids (Srinivas Pandruvada) 2020-12-18 12:19:37 -08:00
thunderbolt
tty FROMLIST: Revert "init/console: Use ttynull as a fallback when there is no console" 2021-01-07 19:45:13 +01:00
uio uio: uio_hv_generic: use devm_kzalloc() for private data alloc 2020-12-09 19:59:00 +01:00
usb ANDROID: usb: gadget: f_accessory: fix CTS test stuck 2020-12-23 15:16:49 +08:00
vdpa
vfio ARM: 2020-12-20 10:44:05 -08:00
vhost vhost: vringh: use krealloc_array() 2020-12-15 12:13:37 -08:00
video UAPI Changes: 2020-12-18 12:38:28 -08:00
virt
virtio Merge ac73e3dc8a ("Merge branch 'akpm' (patches from Andrew)") into android-mainline 2020-12-17 07:57:30 +01:00
visorbus
vlynq
vme vme: switch from 'pci_' to 'dma_' API 2020-12-09 19:44:34 +01:00
w1
watchdog
xen xen: branch for v5.11-rc1b 2020-12-19 12:56:23 -08:00
zorro
Kconfig
Makefile asm-generic: cross-architecture timer cleanup 2020-12-16 00:07:17 -08:00