xen: maintain clock offset over save/restore
authorJeremy Fitzhardinge <jeremy@goop.org>
Mon, 26 May 2008 22:31:28 +0000 (23:31 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 27 May 2008 08:11:38 +0000 (10:11 +0200)
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>
arch/x86/xen/time.c
drivers/xen/manage.c
include/xen/xen-ops.h

index 0bef256e5f2d072e459aba53a232fcf9bd785859..c39e1a5aa241bcce2cb2a070d2dbbe391a28ae31 100644 (file)
@@ -572,14 +572,6 @@ void xen_setup_cpu_clockevents(void)
        clockevents_register_device(&__get_cpu_var(xen_clock_events));
 }
 
-void xen_time_suspend(void)
-{
-}
-
-void xen_time_resume(void)
-{
-}
-
 __init void xen_time_init(void)
 {
        int cpu = smp_processor_id();
index ba85fa2cff334996b781f313dce30eda81205f41..675c3dd23962ff45fa6c058250bbb0c834085be1 100644 (file)
@@ -34,14 +34,21 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID;
 static int xen_suspend(void *data)
 {
        int *cancelled = data;
+       int err;
 
        BUG_ON(!irqs_disabled());
 
        load_cr3(swapper_pg_dir);
 
+       err = device_power_down(PMSG_SUSPEND);
+       if (err) {
+               printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n",
+                      err);
+               return err;
+       }
+
        xen_mm_pin_all();
        gnttab_suspend();
-       xen_time_suspend();
        xen_pre_suspend();
 
        /*
@@ -52,10 +59,11 @@ static int xen_suspend(void *data)
        *cancelled = HYPERVISOR_suspend(virt_to_mfn(xen_start_info));
 
        xen_post_suspend(*cancelled);
-       xen_time_resume();
        gnttab_resume();
        xen_mm_unpin_all();
 
+       device_power_up();
+
        if (!*cancelled) {
                xen_irq_resume();
                xen_console_resume();
@@ -105,7 +113,8 @@ static void do_suspend(void)
 
        device_resume();
 
-
+       /* Make sure timer events get retriggered on all CPUs */
+       clock_was_set();
 out:
 #ifdef CONFIG_PREEMPT
        thaw_processes();
index 5d7a6db54a8c91064a1255e81834c31ce44bbfb1..a706d6a7896016c8698698ad1472a26b7551cab9 100644 (file)
@@ -11,7 +11,4 @@ void xen_post_suspend(int suspend_cancelled);
 void xen_mm_pin_all(void);
 void xen_mm_unpin_all(void);
 
-void xen_time_suspend(void);
-void xen_time_resume(void);
-
 #endif /* INCLUDE_XEN_OPS_H */