Skip to content

Commit

Permalink
xen: suspend and resume system devices when running PVHVM
Browse files Browse the repository at this point in the history
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 <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
  • Loading branch information
Ian Campbell committed Feb 17, 2011
1 parent 100b33c commit 8dd3838
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/xen/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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);
Expand All @@ -53,6 +61,8 @@ static int xen_hvm_suspend(void *data)
xen_timer_resume();
}

sysdev_resume();

return 0;
}

Expand Down

0 comments on commit 8dd3838

Please sign in to comment.