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

[Xen-devel] [PATCH 1 of 3] fix S3 suspend error



# HG changeset patch
# User Guanqun Lu <guanqun.lu@xxxxxxxxx>
# Date 1235401592 -28800
# Node ID b713518a241b6f6e07edb10c3fc38143138f82ea
# Parent  84af3ded5b02ba0b3f8647e3bfa993725428633b
fix S3 suspend error.

invoke ioapic_pm_state_alloc() eariler,
thus avoiding check_lock() BUG_ON() in spin_lock().

Signed-off-by: Guanqun Lu <guanqun.lu@xxxxxxxxx>

diff -r 84af3ded5b02 -r b713518a241b xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Thu Feb 19 11:07:33 2009 +0000
+++ b/xen/arch/x86/io_apic.c    Mon Feb 23 23:06:32 2009 +0800
@@ -1779,6 +1779,22 @@ static inline void check_timer(void)
  */
 #define PIC_IRQS       (1 << PIC_CASCADE_IR)
 
+struct IO_APIC_route_entry *ioapic_pm_state=NULL;
+
+void ioapic_pm_state_alloc(void)
+{
+    int i, nr_entry = 0;
+
+    if (ioapic_pm_state != NULL)
+        return;
+
+    for (i = 0; i < nr_ioapics; i++)
+        nr_entry += nr_ioapic_registers[i];
+
+    ioapic_pm_state = _xmalloc(sizeof(struct IO_APIC_route_entry)*nr_entry,
+                               sizeof(struct IO_APIC_route_entry));
+}
+
 void __init setup_IO_APIC(void)
 {
     enable_IO_APIC();
@@ -1801,24 +1817,9 @@ void __init setup_IO_APIC(void)
     init_IO_APIC_traps();
     check_timer();
     print_IO_APIC();
+    ioapic_pm_state_alloc();
 
     register_keyhandler('z', print_IO_APIC_keyhandler, "print ioapic info");
-}
-
-struct IO_APIC_route_entry *ioapic_pm_state=NULL;
-
-void ioapic_pm_state_alloc(void)
-{
-    int i, nr_entry = 0;
-
-    if (ioapic_pm_state != NULL)
-        return;
-
-    for (i = 0; i < nr_ioapics; i++)
-        nr_entry += nr_ioapic_registers[i];
-
-    ioapic_pm_state = _xmalloc(sizeof(struct IO_APIC_route_entry)*nr_entry,
-                               sizeof(struct IO_APIC_route_entry));
 }
 
 int ioapic_suspend(void)
@@ -1826,8 +1827,6 @@ int ioapic_suspend(void)
     struct IO_APIC_route_entry *entry;
     unsigned long flags;
     int apic,i;
-
-    ioapic_pm_state_alloc();
 
     if (ioapic_pm_state == NULL) {
         printk("Cannot suspend ioapic due to lack of memory\n");

_______________________________________________
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®.