From: Ian Campbell Subject: Re: [PATCH] xen: suspend and resume system devices when running PVHVM Date: Tue, 15 Feb 2011 09:11:52 +0000 Message-ID: <1297761112.21980.3661.camel@zakaz.uk.xensource.com> References: <1297704751-15612-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "rshriram@cs.ubc.ca" Cc: Fitzhardinge , "xen-devel@lists.xensource.com" , Jeremy, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, 2011-02-15 at 05:49 +0000, Shriram Rajagopalan wrote: > On Mon, Feb 14, 2011 at 9:32 AM, Ian Campbell wrote: > > Otherwise we fail to properly suspend/resume all of the emulated devices. > > > > Something between 2.6.38-rc2 and rc3 appears to have exposed this > > issue, but it's always been wrong not to do this. > > > > Signed-off-by: Ian Campbell > > Cc: Stefano Stabellini > > Cc: Jeremy Fitzhardinge > > --- > > drivers/xen/manage.c | 10 ++++++++++ > > 1 files changed, 10 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c > > index db8c4c4..2417727 100644 > > --- a/drivers/xen/manage.c > > +++ b/drivers/xen/manage.c > > @@ -37,11 +37,19 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID; > > #ifdef CONFIG_PM_SLEEP > > static int xen_hvm_suspend(void *data) > > { > > + int err; > > struct sched_shutdown r = { .reason = SHUTDOWN_suspend }; > > int *cancelled = data; > > > > BUG_ON(!irqs_disabled()); > > > > + err = sysdev_suspend(PMSG_SUSPEND); > > Shouldnt this be PMSG_FREEZE ? based on the recent discussion with > linux-pm folks and the issue of xm save -c resulting in guest hangup. After your patch goes upstream, yes I think it should be, however until then PMSG_SUSPEND is consistent with the rest of the code. Ian. > > + if (err) { > > + printk(KERN_ERR "xen_hvm_suspend: sysdev_suspend failed: %d\n", > > + err); > > + return err; > > + } > > + > > *cancelled = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); > > > > xen_hvm_post_suspend(*cancelled); > > @@ -53,6 +61,8 @@ static int xen_hvm_suspend(void *data) > > xen_timer_resume(); > > } > > > > + sysdev_resume(); > > + > > return 0; > > } > > > > -- > > 1.5.6.5 > > > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > >