Jason Wang 891b9dd107 serial-core: restore termios settings when resume console ports
The commit 4547be7 rewrites suspend and resume functions. According
to this rewrite, when a serial port is a printk console device and
can suspend(without set no_console_suspend flag), it will definitely
call set_termios function during its resume, but parameter termios
isn't initialized, this will pass an unpredictable config to the
serial port. If this serial port is not a userspace opened tty device
, a suspend and resume action will make this serial port unusable.
I.E. ttyS0 is a printk console device, ttyS1 or keyboard+display is
userspace tty device, a suspend/resume action will make ttyS0
unusable.

If a serial port is both a printk console device and an opened tty
device, this issue can be overcome because it will call set_termios
again with the correct parameter in the uart_change_speed function.

Refer to the deleted content of commit 4547be7, revert parts relate
to restore settings into parameter termios. It is safe because if
a serial port is a printk console only device, the only meaningful
field in termios is c_cflag and its old config is saved in
uport->cons->cflag, if this port is also an opened tty device,
it will clear uport->cons->cflag in the uart_open and the old config
is saved in tty->termios.

Signed-off-by: Jason Wang <jason77.wang@gmail.com>
Acked-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22 10:20:02 -07:00
..
2010-10-08 22:37:46 -04:00
2010-09-28 23:30:38 -04:00
2010-10-13 15:43:10 -07:00
2010-10-08 22:16:27 -04:00
2010-10-08 10:21:22 -07:00
2010-09-19 22:43:42 -04:00
2010-08-24 15:28:28 +10:00
2010-10-07 12:02:50 +11:00
2010-09-26 15:54:25 +02:00
2010-09-16 11:48:48 -04:00
2010-09-22 16:21:33 +02:00