WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] pvops: Make suspend work when CONFIG_SUSPEND=n

To: xen-devel@xxxxxxxxxxxxxxxxxxx, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] pvops: Make suspend work when CONFIG_SUSPEND=n
From: Frank Pan <frankpzh@xxxxxxxxx>
Date: Fri, 4 Mar 2011 19:20:39 +0800
Cc:
Delivery-date: Fri, 04 Mar 2011 03:21:41 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=WLTK/JsilLA5hpfhReOtgVTdxepSRAg1i/HY6eIZUHQ=; b=QbK3Bz0STNjTfRDARnpUa53GGOaCjMM8wk59ln5ASW/WHtTN/Qu+Su+asU4JLVcHvB PJZFpHy34AF774xmLGvGbU35M22U4JE+SxT574esp60XjqvwqH9yfx2eX3DLvp5UICT3 VCrqh9/A11yykUb5KWCGFQgLHd4X0Vn4qhdrg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=r5HddEPdDL9Zjf1Vzov6IAHH/N2blaWBNYR2VJN8k1esfiakovFGRl6Smr4XPp81Uu 6fpo3B+3rc0mUSv/UB2ufLPRkfqsBbaYJWkJO90+bloWWHzFZXOrkNI5uv1QckICv4xi dPdtvxiTYuFAxD3XO/5cF0F8THebpkKgAZ7Ds=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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: 0001-Make-suspend-work-when-CONFIG_SUSPEND-n.patch
Description: Text Data

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