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: Resume devices when suspend is failed

To: xen-devel@xxxxxxxxxxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH] pvops: Resume devices when suspend is failed
From: Frank Pan <frankpzh@xxxxxxxxx>
Date: Fri, 4 Mar 2011 12:31:34 +0800
Cc:
Delivery-date: Thu, 03 Mar 2011 20:32:52 -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=iijX6M4gDUIdSrvudkoYbXwjsg2nBt5WV4LklMrziKU=; b=AUdOQGC50MNWa4Q8PzjWr3MdoQEIjUX1CDiD2KqmVT2CzZ6ybT2i63YdYYBt9E8zhq EtSq7xUtj6QHh41bh8sc35gBmrlcSJAXIl58XSVeWQEoWyqMZ9sTmlkyNe2qPZFmr29H joytcQxacakjfKhaUPt2LwPiCp+MbpFi3yCTs=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=uGRGJcrUJHSC2rYnM6yKUdymTOf8tn9huGjJoSaL7BhPuSCDO/HorGMNSc85p6sjuY xHKntC0SjR6aQg7yF7psxU1kJ/LP7WkoqjOmOSEMNtvMI2LHLnlRhKN7SDdmiTwirTY8 IluUykwyHQfmjjfe6o72AN4/kbhOwzvis5tnQ=
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 does not call dpm_resume_end when
dpm_suspend_start is failed. This makes some device remain suspended
after the unsuccessful call of do_suspend from xenbus.

In my test, a PV-on-HVM guest printed the following message after
received a suspend request through xenbus, and then stucked due to
disk access.

[41577.764748] sd 0:0:0:0: [sda] Stopping disk
[41577.765273] PM: Device input2 failed to suspend: error -22
[41577.765275] xen suspend: dpm_suspend_start -22

The following patch fixes this by calling dpm_suspend_start after the
failure of dpm_resume_end.
---
 linux-2.6-xen/drivers/xen/manage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/linux-2.6-xen/drivers/xen/manage.c
b/linux-2.6-xen/drivers/xen/manage.c
index 5078704..3eec337 100644
--- a/linux-2.6-xen/drivers/xen/manage.c
+++ b/linux-2.6-xen/drivers/xen/manage.c
@@ -120,6 +120,7 @@ static void do_suspend(void)

        err = dpm_suspend_start(PMSG_SUSPEND);
        if (err) {
+               dpm_resume_end(PMSG_RESUME);
                printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err);
                goto out_thaw;
        }
-- 
1.7.0.4


-- 
潘震皓, Frank Pan

Computer Science and Technology
Tsinghua University

Attachment: 0001-Resume-devices-when-suspend-is-failed.patch
Description: Text Data

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