public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	xen-devel <xen-devel@lists.xensource.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH 11 of 12] xen: maintain clock offset over save/restore
Date: Fri, 23 May 2008 14:41:18 +0100	[thread overview]
Message-ID: <d67b372f709f658274b6.1211550078@localhost> (raw)
In-Reply-To: <patchbomb.1211550067@localhost>

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>
---
 arch/x86/xen/time.c   |    8 --------
 drivers/xen/manage.c  |   15 ++++++++++++---
 include/xen/xen-ops.h |    3 ---
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -565,14 +565,6 @@
 	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();
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -34,14 +34,21 @@
 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,9 +59,10 @@
 	*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();
@@ -105,7 +113,8 @@
 
 	device_resume();
 
-
+	/* Make sure timer events get retriggered on all CPUs */
+	clock_was_set();
 out:
 #ifdef CONFIG_PREEMPT
 	thaw_processes();
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -11,7 +11,4 @@
 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 */



  parent reply	other threads:[~2008-05-23 13:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23 13:41 [PATCH 00 of 12] xen: add save/restore/migrate for Xen domains Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 01 of 12] xen: make phys_to_machine structure dynamic Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 02 of 12] xen: add configurable max domain size Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 03 of 12] xen: efficiently support a holey p2m table Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 04 of 12] xen: make dummy_shared_info non-static Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 05 of 12] xen: add p2m mfn_list_list Jeremy Fitzhardinge
2008-05-28 12:28   ` [bisected] " Ingo Molnar
2008-05-28 14:02     ` Jeremy Fitzhardinge
2008-05-28 14:10       ` Sam Ravnborg
2008-06-02 10:10       ` Ingo Molnar
2008-06-02 13:12         ` Jeremy Fitzhardinge
2008-05-30  7:40     ` Gerd Hoffmann
2008-05-30  8:04       ` Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 06 of 12] xen: add rebind_evtchn_irq Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 07 of 12] xen: fix unbind_from_irq() Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 08 of 12] xen-console: add save/restore Jeremy Fitzhardinge
2008-06-02 11:17   ` Ingo Molnar
2008-06-02 11:18     ` Ingo Molnar
2008-06-02 11:50     ` Jeremy Fitzhardinge
2008-06-02 12:13     ` [Xen-devel] " Markus Armbruster
2008-05-23 13:41 ` [PATCH 09 of 12] xenbus: rebind irq on restore Jeremy Fitzhardinge
2008-05-23 13:41 ` [PATCH 10 of 12] xen: implement save/restore Jeremy Fitzhardinge
2008-05-29  7:31   ` Ingo Molnar
2008-05-29  8:00     ` Jeremy Fitzhardinge
2008-05-29  8:02     ` [PATCH] xen: fix compilation when CONFIG_PM_SLEEP is disabled Jeremy Fitzhardinge
2008-05-30  0:24       ` Randy Dunlap
2008-06-02 10:13         ` Ingo Molnar
2008-06-02  9:21   ` [Xen-devel] [PATCH 10 of 12] xen: implement save/restore Isaku Yamahata
2008-06-02 10:03     ` Jeremy Fitzhardinge
2008-06-02 10:47       ` Isaku Yamahata
2008-06-02 10:52         ` Jeremy Fitzhardinge
2008-05-23 13:41 ` Jeremy Fitzhardinge [this message]
2008-05-23 13:41 ` [PATCH 12 of 12] hrtimer: remove warning in hres_timers_resume Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d67b372f709f658274b6.1211550078@localhost \
    --to=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=tglx@linutronix.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox