linux/drivers
Paul Burton 05fd007e46 console: don't prefer first registered if DT specifies stdout-path
If a device tree specifies a preferred device for kernel console output
via the stdout-path or linux,stdout-path chosen node properties or the
stdout alias then the kernel ought to honor it & output the kernel
console to that device.  As it stands, this isn't the case.  Whilst we
parse the stdout-path properties & set an of_stdout variable from
of_alias_scan(), and use that from of_console_check() to determine
whether to add a console device as a preferred console whilst
registering it, we also prefer the first registered console if no other
has been selected at the time of its registration.

This means that if a console other than the one the device tree selects
via stdout-path is registered first, we will switch to using it & when
the stdout-path console is later registered the call to
add_preferred_console() via of_console_check() is too late to do
anything useful.  In practice this seems to mean that we switch to the
dummy console device fairly early & see no further console output:

    Console: colour dummy device 80x25
    console [tty0] enabled
    bootconsole [ns16550a0] disabled

Fix this by not automatically preferring the first registered console if
one is specified by the device tree.  This allows consoles to be
registered but not enabled, and once the driver for the console selected
by stdout-path calls of_console_check() the driver will be added to the
list of preferred consoles before any other console has been enabled.
When that console is then registered via register_console() it will be
enabled as expected.

Link: http://lkml.kernel.org/r/20160809151937.26118-1-paul.burton@imgtec.com
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ivan Delalande <colona@arista.com>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Jan Kara <jack@suse.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Joe Perches <joe@perches.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-07 18:46:30 -07:00
..
accessibility
acpi nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00
amba
android
ata
atm atm: iphase: fix newline escape and minor tweak to source formatting 2016-09-15 19:15:55 -04:00
auxdisplay
base memory-hotplug: fix store_mem_state() return value 2016-10-07 18:46:28 -07:00
bcma bcma: use of_dma_configure() to set initial dma mask 2016-09-09 12:00:37 +03:00
block
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-10-05 10:11:24 -07:00
bus Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
cdrom
char Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2016-10-04 14:48:27 -07:00
clk CLK: Add Loongson1C clock support 2016-09-23 14:49:21 -07:00
clocksource Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 18:09:13 -07:00
connector
cpufreq Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2016-10-06 07:59:37 -07:00
cpuidle nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00
crypto chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's 2016-09-19 01:37:32 -04:00
dax
dca
devfreq PM / devfreq: rk3399_dmc: Remove explictly regulator_put call in .remove 2016-09-19 13:36:20 +02:00
dio
dma dmaengine updates for 4.8-rc1 2016-10-06 17:13:54 -07:00
dma-buf
edac * Altera Arria10 enablement of NAND, DMA, USB, QSPI and SD-MMC FIFO 2016-10-04 12:06:26 -07:00
eisa
extcon Merge branch 'next' into resolution 2016-09-15 16:45:20 +05:30
firewire
firmware Fix bug in module unloading. 2016-10-06 15:16:16 -07:00
fmc
fpga fpga manager: Add hardware dependency to Zynq driver 2016-09-08 17:31:44 +02:00
gpio Merge branch 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-10-07 14:12:21 -07:00
gpu Merge branch 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-10-07 14:12:21 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2016-10-07 11:58:38 -07:00
hsi
hv Drivers: hv: get rid of id in struct vmbus_channel 2016-09-27 12:35:49 +02:00
hwmon hwmon updates for v4.9 2016-10-04 10:56:14 -07:00
hwspinlock
hwtracing coresight: tmc: mark symbols static where possible 2016-09-09 13:53:00 +02:00
i2c Merge branch 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-10-07 14:12:21 -07:00
ide
idle nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00
iio Staging/IIO patches for 4.9-rc1 2016-10-05 14:50:51 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-10-05 10:11:24 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2016-10-07 09:12:19 -07:00
iommu KVM updates for v4.9-rc1 2016-10-06 10:49:01 -07:00
ipack
irqchip irqchip core changes for v4.9 2016-09-22 22:49:52 +02:00
isdn
leds leds: triggers: Check return value of kobject_uevent_env() 2016-09-20 10:22:10 +02:00
lguest
lightnvm
macintosh
mailbox Merge branch 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration 2016-10-06 17:36:53 -07:00
mcb mcb: Add a dma_device to mcb_device 2016-09-27 12:33:47 +02:00
md Merge tag 'md/4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md 2016-10-07 09:45:43 -07:00
media USB/PHY/EXTCON patches for 4.9-rc1 2016-10-03 20:17:35 -07:00
memory Char/Misc driver update for 4.9-rc1 2016-10-03 19:57:49 -07:00
memstick
message scsi: fusion: Fix error return code in mptfc_probe() 2016-09-14 14:26:19 -04:00
mfd - Core Frameworks 2016-10-07 08:35:35 -07:00
misc Merge branch 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-10-07 14:12:21 -07:00
mmc USB/PHY/EXTCON patches for 4.9-rc1 2016-10-03 20:17:35 -07:00
mtd Another round of MTD fixes for v4.8 2016-09-28 12:53:08 -07:00
net phy: micrel.c: Enable ksz9031 energy-detect power-down mode 2016-10-05 21:19:06 -04:00
nfc
ntb
nubus
nvdimm libnvdimm, region: fix flush hint table thinko 2016-09-24 11:45:38 -07:00
nvme nvme-rdma: only clear queue flags after successful connect 2016-09-22 19:58:17 -06:00
nvmem
of console: don't prefer first registered if DT specifies stdout-path 2016-10-07 18:46:30 -07:00
oprofile oprofile/timer: Convert to hotplug state machine 2016-09-19 21:44:28 +02:00
parisc
parport
pci PCI changes for the v4.9 merge window: 2016-10-07 11:46:37 -07:00
pcmcia pcmcia: lubbock: fix sockets configuration 2016-09-12 10:57:01 +01:00
perf Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
phy phy-twl4030-usb: initialize charging-related stuff via pm_runtime 2016-09-14 10:59:12 +05:30
pinctrl This is the bulk of GPIO changes for the v4.9 series: 2016-10-05 11:49:09 -07:00
platform - Core Frameworks 2016-10-07 08:35:35 -07:00
pnp
power power supply and reset changes for the v4.9 series 2016-10-06 18:21:15 -07:00
powercap x86/cpu: Rename Merrifield2 to Moorefield 2016-09-08 08:13:08 +02:00
pps
ps3
ptp ptp: Fix resource leak in case of error 2016-10-03 21:54:10 -04:00
pwm
rapidio rapidio/rio_cm: avoid GFP_KERNEL in atomic context 2016-09-19 15:36:17 -07:00
ras
regulator - Core Frameworks 2016-10-07 08:35:35 -07:00
remoteproc rpmsg updates for v4.9 2016-10-06 17:03:49 -07:00
reset
rpmsg rpmsg: smd: fix dependency on QCOM_SMD=n 2016-09-12 07:05:13 -07:00
rtc Merge branches 'ib-mfd-gpio-4.9', 'ib-mfd-gpio-regulator-4.9', 'ib-mfd-input-4.9', 'ib-mfd-regulator-4.9', 'ib-mfd-regulator-4.9.1', 'ib-mfd-regulator-rtc-4.9', 'ib-mfd-regulator-rtc-4.9-1' and 'ib-mfd-rtc-4.9' into ibs-for-mfd-merged 2016-10-04 15:47:01 +01:00
s390 SCSI misc on 20161006 2016-10-07 09:28:53 -07:00
sbus
scsi SCSI misc on 20161006 2016-10-07 09:28:53 -07:00
sfi
sh
sn
soc ARM: EXYNOS: Remove calls to of_genpd_get_from_provider() 2016-09-13 02:49:33 +02:00
spi Merge remote-tracking branches 'spi/topic/ti-qspi', 'spi/topic/tools', 'spi/topic/txx9' and 'spi/topic/xlp' into spi-next 2016-09-30 09:14:22 -07:00
spmi spmi: pmic-arb: Return an error code if sanity check fails 2016-09-27 12:43:34 +02:00
ssb
staging cred: simpler, 1D supplementary groups 2016-10-07 18:46:30 -07:00
target chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's 2016-09-19 01:37:32 -04:00
tc
thermal thermal: rcar_thermal: Fix priv->zone error handling 2016-09-06 20:46:06 +08:00
thunderbolt
tty TTY/Serial patches for 4.9-rc1 2016-10-03 20:11:49 -07:00
uio
usb Revert "usbtmc: convert to devm_kzalloc" 2016-09-28 11:51:30 +02:00
uwb
vfio vfio_pci: use pci_alloc_irq_vectors 2016-09-29 13:36:38 -06:00
vhost Merge 4.8-rc5 into char-misc-next 2016-09-05 08:04:07 +02:00
video backlight: pwm_bl: Handle gpio that can sleep 2016-10-06 09:27:26 +01:00
virt
virtio virtio: mark vring_dma_dev() static 2016-09-09 21:12:35 +03:00
vlynq
vme vme: fake: remove unexpected unlock in fake_master_set() 2016-09-27 12:43:35 +02:00
w1
watchdog USB/PHY/EXTCON patches for 4.9-rc1 2016-10-03 20:17:35 -07:00
xen xen: features and fixes for 4.9-rc0 2016-10-06 11:19:10 -07:00
zorro
Kconfig
Makefile clk: probe common clock drivers earlier 2016-09-23 13:00:04 +02:00