[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2 of 5] xen: Support suspend in ns16550 code



# HG changeset patch
# User Tom Goetz <tom.goetz@xxxxxxxxxxxxxxxxxxx>
# Date 1310490365 14400
# Node ID 4c94bcf4b4afb840bc6a037f0782c63ad573f4eb
# Parent  50ce3b9afcd7f43801408f2d1acc686afeb54f00
xen: Support suspend in ns16550 code.

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@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Tom Goetz <tom.goetz@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

diff -r 50ce3b9afcd7 -r 4c94bcf4b4af xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c        Tue Jul 12 13:06:05 2011 -0400
+++ b/xen/drivers/char/ns16550.c        Tue Jul 12 13:06:05 2011 -0400
@@ -353,6 +353,13 @@ static int ns16550_irq(struct serial_por
     return ((uart->irq > 0) ? uart->irq : -1);
 }
 
+static void ns16550_suspend(struct serial_port *port)
+{
+    struct ns16550 *uart = port->uart;
+
+    stop_timer(&uart->timer);
+}
+
 static struct uart_driver __read_mostly ns16550_driver = {
     .init_preirq  = ns16550_init_preirq,
     .init_postirq = ns16550_init_postirq,
@@ -361,7 +368,8 @@ static struct uart_driver __read_mostly 
     .tx_empty     = ns16550_tx_empty,
     .putc         = ns16550_putc,
     .getc         = ns16550_getc,
-    .irq          = ns16550_irq
+    .irq          = ns16550_irq,
+    .suspend      = ns16550_suspend,
 };
 
 static int __init parse_parity_char(int c)



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.