xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pvops: Make suspend work when CONFIG_SUSPEND=n
@ 2011-03-04 11:20 Frank Pan
  2011-03-04 11:35 ` Ian Campbell
  0 siblings, 1 reply; 19+ messages in thread
From: Frank Pan @ 2011-03-04 11:20 UTC (permalink / raw)
  To: xen-devel, Jeremy Fitzhardinge, Konrad Rzeszutek Wilk,
	Ian Campbell

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

Recent pvops kernel fails on suspending some of devices on the
following configuration:

CONFIG_SUSPEND=n
CONFIG_PM_SLEEP=y

Command suspend on control/shutdown is recognized when
CONFIG_PM_SLEEP=y. This indicates the device suspend logic should also
be enabled on this configuration.
The following patch works.
---
 linux-2.6-xen/drivers/base/power/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-2.6-xen/drivers/base/power/main.c
b/linux-2.6-xen/drivers/base/power/main.c
index 8aa2443..4d40fc4 100644
--- a/linux-2.6-xen/drivers/base/power/main.c
+++ b/linux-2.6-xen/drivers/base/power/main.c
@@ -174,7 +174,7 @@ static int pm_op(struct device *dev,
 	int error = 0;

 	switch (state.event) {
-#ifdef CONFIG_SUSPEND
+#if defined(CONFIG_SUSPEND) || defined(CONFIG_XEN_SAVE_RESTORE)
 	case PM_EVENT_SUSPEND:
 		if (ops->suspend) {
 			error = ops->suspend(dev);
@@ -238,7 +238,7 @@ static int pm_noirq_op(struct device *dev,
 	int error = 0;

 	switch (state.event) {
-#ifdef CONFIG_SUSPEND
+#if defined(CONFIG_SUSPEND) || defined(CONFIG_XEN_SAVE_RESTORE)
 	case PM_EVENT_SUSPEND:
 		if (ops->suspend_noirq) {
 			error = ops->suspend_noirq(dev);
-- 
1.7.0.4


-- 
潘震皓, Frank Pan

Computer Science and Technology
Tsinghua University

[-- Attachment #2: 0001-Make-suspend-work-when-CONFIG_SUSPEND-n.patch --]
[-- Type: text/x-patch, Size: 1407 bytes --]

From 941b7222efe8be20ea285f5325fbe46706c55464 Mon Sep 17 00:00:00 2001
From: Frank Pan <frankpzh@gmail.com>
Date: Fri, 4 Mar 2011 18:49:38 +0800
Subject: [PATCH] Make suspend work when CONFIG_SUSPEND=n

Recent pvops kernel fails on suspending some of devices on the following configuration:

CONFIG_SUSPEND=n
CONFIG_PM_SLEEP=y

Command suspend on control/shutdown is recognized when CONFIG_PM_SLEEP=y. This indicates the device suspend logic should also be enabled on this configuration.
The following patch works.
---
 linux-2.6-xen/drivers/base/power/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-2.6-xen/drivers/base/power/main.c b/linux-2.6-xen/drivers/base/power/main.c
index 8aa2443..4d40fc4 100644
--- a/linux-2.6-xen/drivers/base/power/main.c
+++ b/linux-2.6-xen/drivers/base/power/main.c
@@ -174,7 +174,7 @@ static int pm_op(struct device *dev,
 	int error = 0;
 
 	switch (state.event) {
-#ifdef CONFIG_SUSPEND
+#if defined(CONFIG_SUSPEND) || defined(CONFIG_XEN_SAVE_RESTORE)
 	case PM_EVENT_SUSPEND:
 		if (ops->suspend) {
 			error = ops->suspend(dev);
@@ -238,7 +238,7 @@ static int pm_noirq_op(struct device *dev,
 	int error = 0;
 
 	switch (state.event) {
-#ifdef CONFIG_SUSPEND
+#if defined(CONFIG_SUSPEND) || defined(CONFIG_XEN_SAVE_RESTORE)
 	case PM_EVENT_SUSPEND:
 		if (ops->suspend_noirq) {
 			error = ops->suspend_noirq(dev);
-- 
1.7.0.4


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-03-08 15:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 11:20 [PATCH] pvops: Make suspend work when CONFIG_SUSPEND=n Frank Pan
2011-03-04 11:35 ` Ian Campbell
2011-03-04 11:45   ` Frank Pan
2011-03-04 11:52     ` Ian Campbell
2011-03-04 15:42       ` Shriram Rajagopalan
2011-03-04 15:56         ` Konrad Rzeszutek Wilk
2011-03-04 16:29           ` Shriram Rajagopalan
2011-03-04 18:26             ` Q: Clarification about extra option ..Re: " Konrad Rzeszutek Wilk
2011-03-04 19:49               ` Shriram Rajagopalan
2011-03-04 20:07                 ` Rafael J. Wysocki
2011-03-06 20:31                   ` Shriram Rajagopalan
2011-03-06 22:12                     ` Rafael J. Wysocki
2011-03-07 12:44                       ` Stefano Stabellini
2011-03-07 16:33                         ` Shriram Rajagopalan
2011-03-07 17:53                           ` Konrad Rzeszutek Wilk
2011-03-07 18:17                             ` Shriram Rajagopalan
2011-03-08 15:53                               ` Konrad Rzeszutek Wilk
2011-03-07 17:39                       ` Konrad Rzeszutek Wilk
2011-03-04 20:05               ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).