Browse Source

xen: add xen_arch_resume()/xen_timer_resume hook for ia64 support

add xen_timer_resume() hook.

Timer resume should be done after event channel is resumed.
add xen_arch_resume() hook when ipi becomes usable after resume.
After resume, some cpu specific resource must be reinitialized
on ia64 that can't be set by another cpu.

However available hooks is run once on only one cpu so that ipi has
to be used.

During stop_machine_run() ipi can't be used because interrupt is masked.
So add another hook after stop_machine_run().
Another approach might be use resume hook which is run by
device_resume(). However device_resume() may be executed on
suspend error recovery path.

So it is necessary to determine whether it is executed on real resume path
or error recovery path.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Isaku Yamahata 17 years ago
parent
commit
ad55db9fed
4 changed files with 11 additions and 4 deletions
  1. 4 1
      arch/x86/xen/suspend.c
  2. 0 1
      arch/x86/xen/xen-ops.h
  3. 4 2
      drivers/xen/manage.c
  4. 3 0
      include/xen/xen-ops.h

+ 4 - 1
arch/x86/xen/suspend.c

@@ -38,8 +38,11 @@ void xen_post_suspend(int suspend_cancelled)
 		xen_cpu_initialized_map = cpu_online_map;
 		xen_cpu_initialized_map = cpu_online_map;
 #endif
 #endif
 		xen_vcpu_restore();
 		xen_vcpu_restore();
-		xen_timer_resume();
 	}
 	}
 
 
 }
 }
 
 
+void xen_arch_resume(void)
+{
+	/* nothing */
+}

+ 0 - 1
arch/x86/xen/xen-ops.h

@@ -37,7 +37,6 @@ void __init xen_time_init(void);
 unsigned long xen_get_wallclock(void);
 unsigned long xen_get_wallclock(void);
 int xen_set_wallclock(unsigned long time);
 int xen_set_wallclock(unsigned long time);
 unsigned long long xen_sched_clock(void);
 unsigned long long xen_sched_clock(void);
-void xen_timer_resume(void);
 
 
 irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
 irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
 
 

+ 4 - 2
drivers/xen/manage.c

@@ -68,6 +68,7 @@ static int xen_suspend(void *data)
 	if (!*cancelled) {
 	if (!*cancelled) {
 		xen_irq_resume();
 		xen_irq_resume();
 		xen_console_resume();
 		xen_console_resume();
+		xen_timer_resume();
 	}
 	}
 
 
 	return 0;
 	return 0;
@@ -107,9 +108,10 @@ static void do_suspend(void)
 		goto out;
 		goto out;
 	}
 	}
 
 
-	if (!cancelled)
+	if (!cancelled) {
+		xen_arch_resume();
 		xenbus_resume();
 		xenbus_resume();
-	else
+	} else
 		xenbus_suspend_cancel();
 		xenbus_suspend_cancel();
 
 
 	device_resume();
 	device_resume();

+ 3 - 0
include/xen/xen-ops.h

@@ -11,4 +11,7 @@ void xen_post_suspend(int suspend_cancelled);
 void xen_mm_pin_all(void);
 void xen_mm_pin_all(void);
 void xen_mm_unpin_all(void);
 void xen_mm_unpin_all(void);
 
 
+void xen_timer_resume(void);
+void xen_arch_resume(void);
+
 #endif /* INCLUDE_XEN_OPS_H */
 #endif /* INCLUDE_XEN_OPS_H */