]> git.karo-electronics.de Git - linux-beck.git/commit
printk/of_serial: fix serial console cessation part way through boot.
authorStephen Chivers <schivers@csc.com>
Tue, 13 May 2014 22:04:39 +0000 (08:04 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 20:07:27 +0000 (13:07 -0700)
commit7fa21dd8bd191564a195291161d6b43db5d9c350
treefa2e01328a932ad906f3bb6f704973dda716c9ea
parentd4089a332883ad969700aac5dd4dd5f1c4fee825
printk/of_serial: fix serial console cessation part way through boot.

Commit 5f5c9ae56c38942623f69c3e6dc6ec78e4da2076
"serial_core: Unregister console in uart_remove_one_port()"
fixed a crash where a serial port was removed but
not deregistered as a console.

There is a side effect of that commit for platforms having serial consoles
and of_serial configured (CONFIG_SERIAL_OF_PLATFORM). The serial console
is disabled midway through the boot process.

This cessation of the serial console affects PowerPC computers
such as the MVME5100 and SAM440EP.

The sequence is:

bootconsole [udbg0] enabled
....
serial8250/16550 driver initialises and registers its UARTS,
one of these is the serial console.
console [ttyS0] enabled
....
of_serial probes "platform" devices, registering them as it goes.
One of these is the serial console.
console [ttyS0] disabled.

The disabling of the serial console is due to:

a.  unregister_console in printk not clearing the
    CONS_ENABLED bit in the console flags,
    even though it has announced that the console is disabled; and

b.  of_platform_serial_probe in of_serial not setting the port type
    before it registers with serial8250_register_8250_port.

This patch ensures that the serial console is re-enabled when of_serial
registers a serial port that corresponds to the designated console.

Signed-off-by: Stephen Chivers <schivers@csc.com>
Tested-by: Stephen Chivers <schivers@csc.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [unregister_console]
Cc: stable <stable@vger.kernel.org> # 3.15
===
The above failure was identified in Linux-3.15-rc2.

Tested using MVME5100 and SAM440EP PowerPC computers with
kernels built from Linux-3.15-rc5 and tty-next.

The continued operation of the serial console is vital for computers
such as the MVME5100 as that Single Board Computer does not
have any grapical/display hardware.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/of_serial.c
kernel/printk/printk.c