aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-05-26 18:31:28 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-27 04:11:38 -0400
commit359cdd3f866b6219a6729e313faf2221397f3278 (patch)
treeec052599c175ee1ef0a2221670f18f6dad95cc77
parent0e91398f2a5d4eb6b07df8115917d0d1cf3e9b58 (diff)
xen: maintain clock offset over save/restore
Hook into the device model to make sure that timekeeping's resume handler is called. This deals with our clocksource's non-monotonicity over the save/restore. Explicitly call clock_has_changed() to make sure that all the timers get retriggered properly. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/xen/time.c8
-rw-r--r--drivers/xen/manage.c15
-rw-r--r--include/xen/xen-ops.h3
3 files changed, 12 insertions, 14 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 0bef256e5f2d..c39e1a5aa241 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -572,14 +572,6 @@ void xen_setup_cpu_clockevents(void)
572 clockevents_register_device(&__get_cpu_var(xen_clock_events)); 572 clockevents_register_device(&__get_cpu_var(xen_clock_events));
573} 573}
574 574
575void xen_time_suspend(void)
576{
577}
578
579void xen_time_resume(void)
580{
581}
582
583__init void xen_time_init(void) 575__init void xen_time_init(void)
584{ 576{
585 int cpu = smp_processor_id(); 577 int cpu = smp_processor_id();
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index ba85fa2cff33..675c3dd23962 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -34,14 +34,21 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID;
34static int xen_suspend(void *data) 34static int xen_suspend(void *data)
35{ 35{
36 int *cancelled = data; 36 int *cancelled = data;
37 int err;
37 38
38 BUG_ON(!irqs_disabled()); 39 BUG_ON(!irqs_disabled());
39 40
40 load_cr3(swapper_pg_dir); 41 load_cr3(swapper_pg_dir);
41 42
43 err = device_power_down(PMSG_SUSPEND);
44 if (err) {
45 printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n",
46 err);
47 return err;
48 }
49
42 xen_mm_pin_all(); 50 xen_mm_pin_all();
43 gnttab_suspend(); 51 gnttab_suspend();
44 xen_time_suspend();
45 xen_pre_suspend(); 52 xen_pre_suspend();
46 53
47 /* 54 /*
@@ -52,10 +59,11 @@ static int xen_suspend(void *data)
52 *cancelled = HYPERVISOR_suspend(virt_to_mfn(xen_start_info)); 59 *cancelled = HYPERVISOR_suspend(virt_to_mfn(xen_start_info));
53 60
54 xen_post_suspend(*cancelled); 61 xen_post_suspend(*cancelled);
55 xen_time_resume();
56 gnttab_resume(); 62 gnttab_resume();
57 xen_mm_unpin_all(); 63 xen_mm_unpin_all();
58 64
65 device_power_up();
66
59 if (!*cancelled) { 67 if (!*cancelled) {
60 xen_irq_resume(); 68 xen_irq_resume();
61 xen_console_resume(); 69 xen_console_resume();
@@ -105,7 +113,8 @@ static void do_suspend(void)
105 113
106 device_resume(); 114 device_resume();
107 115
108 116 /* Make sure timer events get retriggered on all CPUs */
117 clock_was_set();
109out: 118out:
110#ifdef CONFIG_PREEMPT 119#ifdef CONFIG_PREEMPT
111 thaw_processes(); 120 thaw_processes();
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 5d7a6db54a8c..a706d6a78960 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -11,7 +11,4 @@ void xen_post_suspend(int suspend_cancelled);
11void xen_mm_pin_all(void); 11void xen_mm_pin_all(void);
12void xen_mm_unpin_all(void); 12void xen_mm_unpin_all(void);
13 13
14void xen_time_suspend(void);
15void xen_time_resume(void);
16
17#endif /* INCLUDE_XEN_OPS_H */ 14#endif /* INCLUDE_XEN_OPS_H */