]> git.baikalelectronics.ru Git - kernel.git/commit
serial-core: reset the console speed on resume
authorYin Kangkai <kangkai.yin@linux.intel.com>
Sun, 30 Jan 2011 03:15:30 +0000 (11:15 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 Feb 2011 22:14:00 +0000 (14:14 -0800)
commit284c20ee718cfe58d5757f6f57e5189e3f2e803f
tree00c9f0f8d2d412da128992cc8fe402b933e46e1e
parentc46de96b7a12624a64f365101b4c37606469d90b
serial-core: reset the console speed on resume

On some platforms, we need to restore the console speed on resume even
it was not suspended (no_console_suspend), and on others we don't have
to do that.

So don't care about the "console_suspend_enabled" and unconditionally
reset the console speed if it is a console.

This is actually a redo of c2a2f94 (Set proper console speed on resume
if console suspend is disabled) from Deepak Saxena.  I also tried to
investigate more to find out if this change will break others, here is
what I've found out:

commit c91c27dc74eefd5e977147dae396be5a8bb11170
Author: Jason Wang <jason77.wang@gmail.com>
    serial-core: restore termios settings when resume console ports

commit 58d43b325609b8bf8c99ee8d832500212f5469bb
Author: Jason Wang <jason77.wang@gmail.com>
    serial-core: skip call set_termios/console_start when no_console_suspend

commit 4da740cd762542bc4eb8b728bd1122794e787697
Author: Stanislav Brabec <sbrabec@suse.cz>
    serial-core: resume serial hardware with no_console_suspend

commit c2a2f94bff6388485af0e999af1527662d278c0a
Author: Deepak Saxena <dsaxena@laptop.org>
    Set proper console speed on resume if console suspend is disabled

from c2a2f94, we learned that, even if the console suspend is disabled
(when no_console_suspend is set), we may still need to "reset the port
to the state it was in before we suspended."

Then with 4da740c, this piece of code is removed.

And then Jason Wang added that back in 58d43b3 and c91c27d, to fix
some breakage on OMAP3EVM platform. From 58d43b3 we learned that the
"set_termios" things is actually needed by both console is suspended
and not suspended.

That's why I removed the console_suspended_enabled condition, and only
call console_start() when we actually suspeneded it.

I also noticed in this thread:
http://marc.info/?t=129079257100004&r=1&w=2, which talked about on
some platforms, UART HW will be cut power whether or not we set
no_console_suspend, and then on resume it does not work quite well. I
have a similar HW, and this patch fixed this issue, don't know if this
patch also works on their platforms.

[Update: Stanislav tested this patch on Zaurus and reported it improves the
situation. Thanks.]

CC: Greg KH <greg@kroah.com>
CC: Deepak Saxena <dsaxena@laptop.org>
CC: Jason Wang <jason77.wang@gmail.com>
CC: Stanislav Brabec <sbrabec@suse.cz>
CC: Daniel Drake <dsd@laptop.org>
Signed-off-by: Yin Kangkai <kangkai.yin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/serial/serial_core.c