From patchwork Mon Feb 7 09:08:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "SUZUKI, Kazuhiro" X-Patchwork-Id: 538431 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p17GwjRq012006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 7 Feb 2011 16:59:12 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p17GuF5T002387; Mon, 7 Feb 2011 08:56:46 -0800 Received: from fgwmail5.fujitsu.co.jp (fgwmail5.fujitsu.co.jp [192.51.44.35]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p1798m4B022355 for ; Mon, 7 Feb 2011 01:08:49 -0800 Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id C1F5E3EE0C1; Mon, 7 Feb 2011 18:08:47 +0900 (JST) Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id A948B45DE56; Mon, 7 Feb 2011 18:08:47 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 92DC545DE55; Mon, 7 Feb 2011 18:08:47 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 840E81DB8046; Mon, 7 Feb 2011 18:08:47 +0900 (JST) Received: from dm.kawasaki.flab.fujitsu.co.jp (dm.kawasaki.flab.fujitsu.co.jp [10.25.192.105]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 538091DB803F; Mon, 7 Feb 2011 18:08:47 +0900 (JST) Received: from vs.kawasaki.flab.fujitsu.co.jp (vs.kawasaki.flab.fujitsu.co.jp [10.25.192.38]) by dm.kawasaki.flab.fujitsu.co.jp (8.14.4/8.14.4/100813-Fujitsu Labs. Kawasaki Domain Mail Master) with ESMTP id p1798l5b013753; Mon, 7 Feb 2011 18:08:47 +0900 (JST) X-AuditID: 0a19c026-00000005000001f6-48-4d4fb69e3616 Received: from dm.kawasaki.flab.fujitsu.co.jp (dm.kawasaki.flab.fujitsu.co.jp [10.25.192.105]) by vs.kawasaki.flab.fujitsu.co.jp (Symantec Mail Security) with ESMTP id F1526292B8; Mon, 7 Feb 2011 18:08:46 +0900 (JST) Received: from localhost (ebony.pps.flab.fujitsu.co.jp [10.25.213.112]) by dm.kawasaki.flab.fujitsu.co.jp (8.14.4/8.14.4/100813-Fujitsu Labs. Kawasaki Domain Mail Master) with ESMTP id p1798k9E013746; Mon, 7 Feb 2011 18:08:46 +0900 (JST) Date: Mon, 07 Feb 2011 18:08:46 +0900 (JST) Message-Id: <20110207.180846.2292930419738556212.kaz@jp.fujitsu.com> To: rjw@sisk.pl, linux-pm@lists.linux-foundation.org From: "SUZUKI, Kazuhiro" In-Reply-To: <20110207.180718.885783824287845425.kaz@jp.fujitsu.com> References: <20110207.180718.885783824287845425.kaz@jp.fujitsu.com> X-Mailer: Mew version 6.3 on Emacs 23.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 X-Brightmail-Tracker: AAAAAA== Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-103.749 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SPF_PASS, OSDL_HEADER_SUBJECT_BRACKETED, USER_IN_WHITELIST X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 X-Mailman-Approved-At: Mon, 07 Feb 2011 08:48:36 -0800 Cc: xen-devel@lists.xensource.com Subject: [linux-pm] [PATCH 2/2] Fix hangup after creating checkpoint on Xen. X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 07 Feb 2011 16:59:12 +0000 (UTC) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 3f71199..22c6288 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1293,7 +1293,7 @@ static void xennet_disconnect_backend(struct netfront_info *info) info->rx.sring = NULL; } -static int netfront_suspend(struct xenbus_device *dev, pm_message_t state) +static int netfront_suspend(struct xenbus_device *dev) { struct netfront_info *info = dev_get_drvdata(&dev->dev); struct hrtimer *timer = &info->smart_poll.timer; diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 0b50906..845afb8 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -148,10 +148,11 @@ out_resume: if (!cancelled) { xen_arch_resume(); xs_resume(); - } else + dpm_resume_end(PMSG_RESUME); + } else { xs_suspend_cancel(); - - dpm_resume_end(PMSG_RESUME); + dpm_resume_end(PMSG_CANCEL); + } /* Make sure timer events get retriggered on all CPUs */ clock_was_set(); diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 3a83ba2..02dbb8b 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -575,7 +575,7 @@ void xenbus_dev_changed(const char *node, struct xen_bus_type *bus) } EXPORT_SYMBOL_GPL(xenbus_dev_changed); -int xenbus_dev_suspend(struct device *dev, pm_message_t state) +int xenbus_dev_suspend(struct device *dev) { int err = 0; struct xenbus_driver *drv; @@ -587,7 +587,7 @@ int xenbus_dev_suspend(struct device *dev, pm_message_t state) return 0; drv = to_xenbus_driver(dev->driver); if (drv->suspend) - err = drv->suspend(xdev, state); + err = drv->suspend(xdev); if (err) printk(KERN_WARNING "xenbus: suspend %s failed: %i\n", dev_name(dev), err); @@ -638,6 +638,14 @@ int xenbus_dev_resume(struct device *dev) } EXPORT_SYMBOL_GPL(xenbus_dev_resume); +int xenbus_dev_cancel(struct device *dev) +{ + /* Do nothing */ + DPRINTK("cancel"); + return 0; +} +EXPORT_SYMBOL_GPL(xenbus_dev_cancel); + /* A flag to determine if xenstored is 'ready' (i.e. has started) */ int xenstored_ready = 0; diff --git a/drivers/xen/xenbus/xenbus_probe.h b/drivers/xen/xenbus/xenbus_probe.h index 0e5fc4c..4019187 100644 --- a/drivers/xen/xenbus/xenbus_probe.h +++ b/drivers/xen/xenbus/xenbus_probe.h @@ -62,8 +62,9 @@ extern void xenbus_dev_changed(const char *node, struct xen_bus_type *bus); extern void xenbus_dev_shutdown(struct device *_dev); -extern int xenbus_dev_suspend(struct device *dev, pm_message_t state); +extern int xenbus_dev_suspend(struct device *dev); extern int xenbus_dev_resume(struct device *dev); +extern int xenbus_dev_cancel(struct device *dev); extern void xenbus_otherend_changed(struct xenbus_watch *watch, const char **vec, unsigned int len, diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index 5413248..6dfc588 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c @@ -82,6 +82,11 @@ static struct device_attribute xenbus_frontend_dev_attrs[] = { __ATTR_NULL }; +static struct dev_pm_ops xenbus_pm_ops = { + .suspend = xenbus_dev_suspend, + .resume = xenbus_dev_resume, + .cancel = xenbus_dev_cancel, +}; static struct xen_bus_type xenbus_frontend = { .root = "device", @@ -98,8 +103,7 @@ static struct xen_bus_type xenbus_frontend = { .shutdown = xenbus_dev_shutdown, .dev_attrs= xenbus_frontend_dev_attrs, - .suspend = xenbus_dev_suspend, - .resume = xenbus_dev_resume, + .pm = &xenbus_pm_ops, }, }; diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 542ca7c..23e7f25 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h @@ -91,7 +91,7 @@ struct xenbus_driver { void (*otherend_changed)(struct xenbus_device *dev, enum xenbus_state backend_state); int (*remove)(struct xenbus_device *dev); - int (*suspend)(struct xenbus_device *dev, pm_message_t state); + int (*suspend)(struct xenbus_device *dev); int (*resume)(struct xenbus_device *dev); int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *); struct device_driver driver;