linux/drivers/of
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
..
unittest-data of/unittest: replace 'selftest' with 'unittest' 2015-03-25 00:53:29 -05:00
address.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
base.c console: don't prefer first registered if DT specifies stdout-path 2016-10-07 18:46:30 -07:00
device.c iommu: of: enforce const-ness of struct iommu_ops 2016-05-09 15:33:29 +02:00
dynamic.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
fdt_address.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
fdt.c of/serial: move earlycon early_param handling to serial 2016-09-28 17:43:15 +02:00
irq.c of/irq: Mark interrupt controllers as populated before initialisation 2016-08-09 12:36:28 -05:00
Kconfig of_mdio: select fixed phy support unconditionally 2016-06-28 05:47:52 -04:00
Makefile MTD updates for v4.7: 2016-05-24 11:00:20 -07:00
of_mdio.c of_mdio: Abstract a general interface for phy connect 2016-07-16 21:32:58 -07:00
of_net.c of_net: factor out repetitive code from of_get_mac_address() 2015-03-29 08:56:17 +01:00
of_numa.c of_numa: Use pr_fmt() 2016-09-09 14:59:09 +01:00
of_pci_irq.c of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages. 2015-09-17 14:46:11 -05:00
of_pci.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
of_private.h of: fix memory leak related to safe_name() 2016-06-24 15:16:10 -05:00
of_reserved_mem.c DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
overlay.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of/platform: Initialise dev->fwnode appropriately 2016-09-15 08:35:56 -05:00
resolver.c of: overlay: add resolver error prints 2016-07-18 17:18:36 -05:00
unittest.c of: unittest: use of_platform_default_populate() to populate default bus 2016-06-23 15:00:59 -05:00