]> Git Repo - linux.git/commit
console: don't prefer first registered if DT specifies stdout-path
authorPaul Burton <[email protected]>
Sat, 8 Oct 2016 00:03:15 +0000 (17:03 -0700)
committerLinus Torvalds <[email protected]>
Sat, 8 Oct 2016 01:46:30 +0000 (18:46 -0700)
commit05fd007e46296afb24d15c7d589d535e5a5b9d5c
tree281299e8ad44d78a2215f54c5dda0272b0c277bf
parent81243eacfa400f5f7b89f4c2323d0de9982bb0fb
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/[email protected]
Signed-off-by: Paul Burton <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Ivan Delalande <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Frank Rowand <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/of/base.c
include/linux/console.h
kernel/printk/printk.c
This page took 0.056086 seconds and 4 git commands to generate.