ns16550: Implement suspend handler.

For PCI type cards, you need to disable the timer code during
suspend. Otherwise during resume, the timer can be put on the
heap as its being resumed and corrupt it resulting in a crash.

Signed-off-by: Roger Cruz <roger.cruz@virtualcomputer.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
Konrad Rzeszutek Wilk committed 2011-07-08 08:42:30 +01:00
1 parent 1d67ac323c
commit 7c7a202cce
1 file changed
+7
+7
View File
@@ -328,6 +328,12 @@ static void __init ns16550_init_postirq(struct serial_port *port)
ns16550_setup_postirq(uart);
}
static void ns16550_suspend(struct serial_port *port)
{
struct ns16550 *uart = port->uart;
stop_timer(&uart->timer);
}
static void ns16550_resume(struct serial_port *port)
{
ns16550_setup_preirq(port->uart);
@@ -355,6 +361,7 @@ static struct uart_driver __read_mostly ns16550_driver = {
.init_preirq = ns16550_init_preirq,
.init_postirq = ns16550_init_postirq,
.endboot = ns16550_endboot,
.suspend = ns16550_suspend,
.resume = ns16550_resume,
.tx_empty = ns16550_tx_empty,
.putc = ns16550_putc,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.