From patchwork Mon Feb 7 09:08:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "SUZUKI, Kazuhiro" X-Patchwork-Id: 538411 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 p17GuaNI010850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 7 Feb 2011 16:57:02 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 p17GsFuq001968; Mon, 7 Feb 2011 08:54:44 -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 p1798hhL022349 for ; Mon, 7 Feb 2011 01:08:44 -0800 Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id C9EFE3EE0C0; Mon, 7 Feb 2011 18:08:42 +0900 (JST) Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id B097C45DE4F; Mon, 7 Feb 2011 18:08:42 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 91B3A45DE4E; Mon, 7 Feb 2011 18:08:42 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 84B82EF8002; Mon, 7 Feb 2011 18:08:42 +0900 (JST) Received: from dm.kawasaki.flab.fujitsu.co.jp (dm.kawasaki.flab.fujitsu.co.jp [10.25.192.105]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 552DBEF8001; Mon, 7 Feb 2011 18:08:42 +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 p1798g9j013727; Mon, 7 Feb 2011 18:08:42 +0900 (JST) X-AuditID: 0a19c026-00000009000001f6-44-4d4fb69a0908 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 02DB4292B8; Mon, 7 Feb 2011 18:08:42 +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 p1798f16013724; Mon, 7 Feb 2011 18:08:41 +0900 (JST) Date: Mon, 07 Feb 2011 18:08:41 +0900 (JST) Message-Id: <20110207.180841.1017043963161295322.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 1/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:57:02 +0000 (UTC) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 8aa2443..e348b5d 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -181,6 +181,13 @@ static int pm_op(struct device *dev, suspend_report_result(ops->suspend, error); } break; + case PM_EVENT_CANCEL: + if (ops->cancel) { + error = ops->cancel(dev); + suspend_report_result(ops->cancel, error); + break; + } + /* Fall through */ case PM_EVENT_RESUME: if (ops->resume) { error = ops->resume(dev); @@ -293,6 +300,8 @@ static char *pm_verb(int event) return "suspend"; case PM_EVENT_RESUME: return "resume"; + case PM_EVENT_CANCEL: + return "cancel"; case PM_EVENT_FREEZE: return "freeze"; case PM_EVENT_QUIESCE: diff --git a/include/linux/pm.h b/include/linux/pm.h index 3b7e04b..d118781 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -198,6 +198,7 @@ struct dev_pm_ops { void (*complete)(struct device *dev); int (*suspend)(struct device *dev); int (*resume)(struct device *dev); + int (*cancel)(struct device *dev); int (*freeze)(struct device *dev); int (*thaw)(struct device *dev); int (*poweroff)(struct device *dev); @@ -291,6 +292,7 @@ struct dev_pm_ops name = { \ #define PM_EVENT_USER 0x0100 #define PM_EVENT_REMOTE 0x0200 #define PM_EVENT_AUTO 0x0400 +#define PM_EVENT_CANCEL 0x0800 #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) @@ -308,6 +310,7 @@ struct dev_pm_ops name = { \ #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) +#define PMSG_CANCEL ((struct pm_message){ .event = PM_EVENT_CANCEL, }) #define PMSG_USER_SUSPEND ((struct pm_message) \ { .event = PM_EVENT_USER_SUSPEND, }) #define PMSG_USER_RESUME ((struct pm_message) \