WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

# HG changeset patch
# User Tom Goetz <tom.goetz@xxxxxxxxxxxxxxxxxxx>
# Date 1310047154 14400
# Node ID 8d328f424b554a5714fccc6fd426111bec57a531
# Parent  7cdc5770d13bbd7fc2b958ba7d74787ff4e20eef
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 7cdc5770d13b -r 8d328f424b55 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c        Thu Jul 07 09:59:09 2011 -0400
+++ b/xen/drivers/char/ns16550.c        Thu Jul 07 09:59:14 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