diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-11 16:54:42 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-11 16:54:42 -0400 |
commit | 1f112cee07b314e244ee9e71d9c1e6950dc13327 (patch) | |
tree | e089e646c78701e37b4ebe00db36082e47cab2d5 /drivers/xen | |
parent | b42282e5a05018ecdc0d63a4ad530b0999785912 (diff) |
PM / Hibernate: Introduce CONFIG_HIBERNATE_CALLBACKS
Xen save/restore is going to use hibernate device callbacks for
quiescing devices and putting them back to normal operations and it
would need to select CONFIG_HIBERNATION for this purpose. However,
that also would cause the hibernate interfaces for user space to be
enabled, which might confuse user space, because the Xen kernels
don't support hibernation. Moreover, it would be wasteful, as it
would make the Xen kernels include a substantial amount of code that
they would never use.
To address this issue introduce new power management Kconfig option
CONFIG_HIBERNATE_CALLBACKS, such that it will only select the code
that is necessary for the hibernate device callbacks to work and make
CONFIG_HIBERNATION select it. Then, Xen save/restore will be able to
select CONFIG_HIBERNATE_CALLBACKS without dragging the entire
hibernate code along with it.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/manage.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 95143dd6904d..1ac94125bf93 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -61,7 +61,7 @@ static void xen_post_suspend(int cancelled) | |||
61 | xen_mm_unpin_all(); | 61 | xen_mm_unpin_all(); |
62 | } | 62 | } |
63 | 63 | ||
64 | #ifdef CONFIG_HIBERNATION | 64 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
65 | static int xen_suspend(void *data) | 65 | static int xen_suspend(void *data) |
66 | { | 66 | { |
67 | struct suspend_info *si = data; | 67 | struct suspend_info *si = data; |
@@ -173,7 +173,7 @@ out: | |||
173 | #endif | 173 | #endif |
174 | shutting_down = SHUTDOWN_INVALID; | 174 | shutting_down = SHUTDOWN_INVALID; |
175 | } | 175 | } |
176 | #endif /* CONFIG_HIBERNATION */ | 176 | #endif /* CONFIG_HIBERNATE_CALLBACKS */ |
177 | 177 | ||
178 | struct shutdown_handler { | 178 | struct shutdown_handler { |
179 | const char *command; | 179 | const char *command; |
@@ -202,7 +202,7 @@ static void shutdown_handler(struct xenbus_watch *watch, | |||
202 | { "poweroff", do_poweroff }, | 202 | { "poweroff", do_poweroff }, |
203 | { "halt", do_poweroff }, | 203 | { "halt", do_poweroff }, |
204 | { "reboot", do_reboot }, | 204 | { "reboot", do_reboot }, |
205 | #ifdef CONFIG_HIBERNATION | 205 | #ifdef CONFIG_HIBERNATE_CALLBACKS |
206 | { "suspend", do_suspend }, | 206 | { "suspend", do_suspend }, |
207 | #endif | 207 | #endif |
208 | {NULL, NULL}, | 208 | {NULL, NULL}, |