From 73c3d657d87c76db03aa26004b61d5675a5265ba Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 17 Feb 2011 11:04:20 +0000 Subject: [PATCH] --- yaml --- r: 234231 b: refs/heads/master c: 82043bb60d24d2897074905c94be5a53071e8913 h: refs/heads/master i: 234229: 61b635341a818e2d1fafb35968619294cab715b0 234227: 96807367ea7a93e5a6351d650bd3b1d342294801 234223: bed15a0091826b405489b636d45544ecd2907e20 v: v3 --- [refs] | 2 +- trunk/drivers/xen/manage.c | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index a2c38e9466e1..ab83660676f8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 03c8142bd2fb3b87effa6ecb2f8957be588bc85f +refs/heads/master: 82043bb60d24d2897074905c94be5a53071e8913 diff --git a/trunk/drivers/xen/manage.c b/trunk/drivers/xen/manage.c index 134eb73ca596..33312c09829e 100644 --- a/trunk/drivers/xen/manage.c +++ b/trunk/drivers/xen/manage.c @@ -39,6 +39,23 @@ struct suspend_info { unsigned long arg; /* extra hypercall argument */ }; +static void xen_hvm_post_suspend(void) +{ + gnttab_resume(); +} + +static void xen_pre_suspend(void) +{ + xen_mm_pin_all(); + gnttab_suspend(); +} + +static void xen_post_suspend(void) +{ + gnttab_resume(); + xen_mm_unpin_all(); +} + #ifdef CONFIG_PM_SLEEP static int xen_hvm_suspend(void *data) { @@ -62,7 +79,7 @@ static int xen_hvm_suspend(void *data) si->cancelled = HYPERVISOR_suspend(si->arg); xen_arch_hvm_post_suspend(si->cancelled); - gnttab_resume(); + xen_hvm_post_suspend(); if (!si->cancelled) { xen_irq_resume(); @@ -89,8 +106,7 @@ static int xen_suspend(void *data) return err; } - xen_mm_pin_all(); - gnttab_suspend(); + xen_pre_suspend(); xen_arch_pre_suspend(); /* @@ -101,8 +117,7 @@ static int xen_suspend(void *data) si->cancelled = HYPERVISOR_suspend(si->arg); xen_arch_post_suspend(si->cancelled); - gnttab_resume(); - xen_mm_unpin_all(); + xen_post_suspend(); if (!si->cancelled) { xen_irq_resume();