serial: core: Preserve termios c_cflag for console resume
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 9 Jul 2014 13:21:14 +0000 (09:21 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 13 Sep 2014 22:41:37 +0000 (23:41 +0100)
commite6fad979c3847f80e0ed868ba3f083aab4032584
treec6f88bf4a6ecb788485c1a390a3d00e304183c50
parente45a1a0bbce84b4c8684e8b79e61a822995a31fc
serial: core: Preserve termios c_cflag for console resume

commit ae84db9661cafc63d179e1d985a2c5b841ff0ac4 upstream.

When a tty is opened for the serial console, the termios c_cflag
settings are inherited from the console line settings.
However, if the tty is subsequently closed, the termios settings
are lost. This results in a garbled console if the console is later
suspended and resumed.

Preserve the termios c_cflag for the serial console when the tty
is shutdown; this reflects the most recent line settings.

Fixes: Bugzilla #69751, 'serial console does not wake from S3'
Reported-by: Valerio Vanni <valerio.vanni@inwind.it>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: tty_struct::termios is a pointer]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/tty/serial/serial_core.c