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>
This commit is contained in:
parent
b42282e5a0
commit
1f112cee07
8 changed files with 27 additions and 28 deletions
|
@ -61,7 +61,7 @@ static void xen_post_suspend(int cancelled)
|
|||
xen_mm_unpin_all();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HIBERNATION
|
||||
#ifdef CONFIG_HIBERNATE_CALLBACKS
|
||||
static int xen_suspend(void *data)
|
||||
{
|
||||
struct suspend_info *si = data;
|
||||
|
@ -173,7 +173,7 @@ out:
|
|||
#endif
|
||||
shutting_down = SHUTDOWN_INVALID;
|
||||
}
|
||||
#endif /* CONFIG_HIBERNATION */
|
||||
#endif /* CONFIG_HIBERNATE_CALLBACKS */
|
||||
|
||||
struct shutdown_handler {
|
||||
const char *command;
|
||||
|
@ -202,7 +202,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
|
|||
{ "poweroff", do_poweroff },
|
||||
{ "halt", do_poweroff },
|
||||
{ "reboot", do_reboot },
|
||||
#ifdef CONFIG_HIBERNATION
|
||||
#ifdef CONFIG_HIBERNATE_CALLBACKS
|
||||
{ "suspend", do_suspend },
|
||||
#endif
|
||||
{NULL, NULL},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue