From af508b34d27e3341287d89e0eae6752fdb1b873f Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 26 Oct 2007 00:59:31 +0200 Subject: Hibernation: Introduce SNAPSHOT_GET_IMAGE_SIZE ioctl Add a new ioctl, SNAPSHOT_GET_IMAGE_SIZE, returning the size of the (just created) hibernation image, to the hibernation userland interface. This ioctl is necessary so that the userland utilities using the interface need not access the hibernation image header, owned by the kernel, in order to obtain the size of the image. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/power.h | 4 +++- kernel/power/snapshot.c | 7 ++++++- kernel/power/user.c | 18 ++++++++++++++---- 3 files changed, 23 insertions(+), 6 deletions(-) (limited to 'kernel') diff --git a/kernel/power/power.h b/kernel/power/power.h index 2093c3a9a994..23c17031ed21 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -128,6 +128,7 @@ struct snapshot_handle { #define data_of(handle) ((handle).buffer + (handle).buf_offset) extern unsigned int snapshot_additional_pages(struct zone *zone); +extern unsigned long snapshot_get_image_size(void); extern int snapshot_read_next(struct snapshot_handle *handle, size_t count); extern int snapshot_write_next(struct snapshot_handle *handle, size_t count); extern void snapshot_write_finalize(struct snapshot_handle *handle); @@ -158,7 +159,8 @@ struct resume_swap_area { #define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int) #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ struct resume_swap_area) -#define SNAPSHOT_IOC_MAXNR 13 +#define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t) +#define SNAPSHOT_IOC_MAXNR 14 #define PMOPS_PREPARE 1 #define PMOPS_ENTER 2 diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 78039b477d2b..c5ce0f34a5d4 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -1264,12 +1264,17 @@ static char *check_image_kernel(struct swsusp_info *info) } #endif /* CONFIG_ARCH_HIBERNATION_HEADER */ +unsigned long snapshot_get_image_size(void) +{ + return nr_copy_pages + nr_meta_pages + 1; +} + static int init_header(struct swsusp_info *info) { memset(info, 0, sizeof(struct swsusp_info)); info->num_physpages = num_physpages; info->image_pages = nr_copy_pages; - info->pages = nr_copy_pages + nr_meta_pages + 1; + info->pages = snapshot_get_image_size(); info->size = info->pages; info->size <<= PAGE_SHIFT; return init_header_complete(info); diff --git a/kernel/power/user.c b/kernel/power/user.c index 5bd321bcbb75..88aac26e598a 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -133,7 +133,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, { int error = 0; struct snapshot_data *data; - loff_t avail; + loff_t size; sector_t offset; if (_IOC_TYPE(cmd) != SNAPSHOT_IOC_MAGIC) @@ -210,10 +210,20 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, image_size = arg; break; + case SNAPSHOT_GET_IMAGE_SIZE: + if (!data->ready) { + error = -ENODATA; + break; + } + size = snapshot_get_image_size(); + size <<= PAGE_SHIFT; + error = put_user(size, (loff_t __user *)arg); + break; + case SNAPSHOT_AVAIL_SWAP: - avail = count_swap_pages(data->swap, 1); - avail <<= PAGE_SHIFT; - error = put_user(avail, (loff_t __user *)arg); + size = count_swap_pages(data->swap, 1); + size <<= PAGE_SHIFT; + error = put_user(size, (loff_t __user *)arg); break; case SNAPSHOT_GET_SWAP_PAGE: -- cgit v1.2.3 From eb57c1cf059630454b40fb8bb124e3f318d241f8 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 26 Oct 2007 01:01:10 +0200 Subject: Hibernation: Rework platform support ioctls (rev. 2) Modify the hibernation userland interface by adding two new ioctls to it, SNAPSHOT_PLATFORM_SUPPORT and SNAPSHOT_POWER_OFF, that can be used, respectively, to switch the hibernation platform support on/off and to make the kernel transition the system to the hibernation state (eg. ACPI S4) using the platform (eg. ACPI) driver. These ioctls are intended to replace the misdesigned SNAPSHOT_PMOPS ioctl, which from now is regarded as obsolete and will be removed in the future. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/power.h | 9 +++------ kernel/power/user.c | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 16 deletions(-) (limited to 'kernel') diff --git a/kernel/power/power.h b/kernel/power/power.h index 23c17031ed21..6ca85fd4975f 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -156,15 +156,12 @@ struct resume_swap_area { #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) #define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int) #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) -#define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int) #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ struct resume_swap_area) #define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t) -#define SNAPSHOT_IOC_MAXNR 14 - -#define PMOPS_PREPARE 1 -#define PMOPS_ENTER 2 -#define PMOPS_FINISH 3 +#define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15) +#define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16) +#define SNAPSHOT_IOC_MAXNR 16 /* If unset, the snapshot device cannot be open. */ extern atomic_t snapshot_device_available; diff --git a/kernel/power/user.c b/kernel/power/user.c index 88aac26e598a..de3fb433ae39 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -28,6 +28,18 @@ #include "power.h" +/* + * NOTE: The SNAPSHOT_PMOPS ioctl is obsolete and will be removed in the + * future. It is only preserved here for compatibility with existing userland + * utilities. + */ +#define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int) + +#define PMOPS_PREPARE 1 +#define PMOPS_ENTER 2 +#define PMOPS_FINISH 3 + + #define SNAPSHOT_MINOR 231 static struct snapshot_data { @@ -36,7 +48,7 @@ static struct snapshot_data { int mode; char frozen; char ready; - char platform_suspend; + char platform_support; } snapshot_state; atomic_t snapshot_device_available = ATOMIC_INIT(1); @@ -70,7 +82,7 @@ static int snapshot_open(struct inode *inode, struct file *filp) } data->frozen = 0; data->ready = 0; - data->platform_suspend = 0; + data->platform_support = 0; return 0; } @@ -183,7 +195,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, error = -EPERM; break; } - error = hibernation_snapshot(data->platform_suspend); + error = hibernation_snapshot(data->platform_support); if (!error) error = put_user(in_suspend, (unsigned int __user *)arg); if (!error) @@ -197,7 +209,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, error = -EPERM; break; } - error = hibernation_restore(data->platform_suspend); + error = hibernation_restore(data->platform_support); break; case SNAPSHOT_FREE: @@ -285,26 +297,33 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, mutex_unlock(&pm_mutex); break; - case SNAPSHOT_PMOPS: + case SNAPSHOT_PLATFORM_SUPPORT: + data->platform_support = !!arg; + break; + + case SNAPSHOT_POWER_OFF: + if (data->platform_support) + error = hibernation_platform_enter(); + break; + + case SNAPSHOT_PMOPS: /* This ioctl is deprecated */ error = -EINVAL; switch (arg) { case PMOPS_PREPARE: - data->platform_suspend = 1; + data->platform_support = 1; error = 0; break; case PMOPS_ENTER: - if (data->platform_suspend) + if (data->platform_support) error = hibernation_platform_enter(); - break; case PMOPS_FINISH: - if (data->platform_suspend) + if (data->platform_support) error = 0; - break; default: -- cgit v1.2.3 From 96f737490cfc368fdafe49769f52fc8460f9349f Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 26 Oct 2007 01:02:15 +0200 Subject: Hibernation: Mark SNAPSHOT_SET_SWAP_FILE ioctl as deprecated (rev. 2) Mark the SNAPSHOT_SET_SWAP_FILE ioctl belonging to the hibernation userland interface as deprecated. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/power.h | 1 - kernel/power/user.c | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'kernel') diff --git a/kernel/power/power.h b/kernel/power/power.h index 6ca85fd4975f..8837ea334e33 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -154,7 +154,6 @@ struct resume_swap_area { #define SNAPSHOT_AVAIL_SWAP _IOR(SNAPSHOT_IOC_MAGIC, 7, void *) #define SNAPSHOT_GET_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 8, void *) #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) -#define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int) #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ struct resume_swap_area) diff --git a/kernel/power/user.c b/kernel/power/user.c index de3fb433ae39..5e866e078550 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -29,10 +29,11 @@ #include "power.h" /* - * NOTE: The SNAPSHOT_PMOPS ioctl is obsolete and will be removed in the - * future. It is only preserved here for compatibility with existing userland - * utilities. + * NOTE: The SNAPSHOT_SET_SWAP_FILE and SNAPSHOT_PMOPS ioctls are obsolete and + * will be removed in the future. They are only preserved here for + * compatibility with existing userland utilities. */ +#define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int) #define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int) #define PMOPS_PREPARE 1 @@ -260,7 +261,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, free_all_swap_pages(data->swap); break; - case SNAPSHOT_SET_SWAP_FILE: + case SNAPSHOT_SET_SWAP_FILE: /* This ioctl is deprecated */ if (!swsusp_swap_in_use()) { /* * User space encodes device types as two-byte values, -- cgit v1.2.3 From cc5d207c85b9a6fafebe2856ead0a9360978c8cd Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 26 Oct 2007 01:03:33 +0200 Subject: Hibernation: Correct definitions of some ioctls (rev. 2) Three ioctl numbers belonging to the hibernation userland interface, SNAPSHOT_ATOMIC_SNAPSHOT, SNAPSHOT_AVAIL_SWAP, SNAPSHOT_GET_SWAP_PAGE, are defined in a wrong way (eg. not portable). Provide new ioctl numbers for these ioctls and mark the existing ones as deprecated. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/power.h | 10 +++++----- kernel/power/user.c | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'kernel') diff --git a/kernel/power/power.h b/kernel/power/power.h index 8837ea334e33..0dd66fabd393 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -147,12 +147,8 @@ struct resume_swap_area { #define SNAPSHOT_IOC_MAGIC '3' #define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1) #define SNAPSHOT_UNFREEZE _IO(SNAPSHOT_IOC_MAGIC, 2) -#define SNAPSHOT_ATOMIC_SNAPSHOT _IOW(SNAPSHOT_IOC_MAGIC, 3, void *) #define SNAPSHOT_ATOMIC_RESTORE _IO(SNAPSHOT_IOC_MAGIC, 4) #define SNAPSHOT_FREE _IO(SNAPSHOT_IOC_MAGIC, 5) -#define SNAPSHOT_SET_IMAGE_SIZE _IOW(SNAPSHOT_IOC_MAGIC, 6, unsigned long) -#define SNAPSHOT_AVAIL_SWAP _IOR(SNAPSHOT_IOC_MAGIC, 7, void *) -#define SNAPSHOT_GET_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 8, void *) #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ @@ -160,7 +156,11 @@ struct resume_swap_area { #define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t) #define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15) #define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16) -#define SNAPSHOT_IOC_MAXNR 16 +#define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int) +#define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18) +#define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, loff_t) +#define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, loff_t) +#define SNAPSHOT_IOC_MAXNR 20 /* If unset, the snapshot device cannot be open. */ extern atomic_t snapshot_device_available; diff --git a/kernel/power/user.c b/kernel/power/user.c index 5e866e078550..b902a7e3bd12 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -40,6 +40,16 @@ #define PMOPS_ENTER 2 #define PMOPS_FINISH 3 +/* + * NOTE: The following ioctl definitions are wrong and have been replaced with + * correct ones. They are only preserved here for compatibility with existing + * userland utilities and will be removed in the future. + */ +#define SNAPSHOT_ATOMIC_SNAPSHOT _IOW(SNAPSHOT_IOC_MAGIC, 3, void *) +#define SNAPSHOT_SET_IMAGE_SIZE _IOW(SNAPSHOT_IOC_MAGIC, 6, unsigned long) +#define SNAPSHOT_AVAIL_SWAP _IOR(SNAPSHOT_IOC_MAGIC, 7, void *) +#define SNAPSHOT_GET_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 8, void *) + #define SNAPSHOT_MINOR 231 @@ -191,6 +201,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, data->frozen = 0; break; + case SNAPSHOT_CREATE_IMAGE: case SNAPSHOT_ATOMIC_SNAPSHOT: if (data->mode != O_RDONLY || !data->frozen || data->ready) { error = -EPERM; @@ -198,7 +209,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, } error = hibernation_snapshot(data->platform_support); if (!error) - error = put_user(in_suspend, (unsigned int __user *)arg); + error = put_user(in_suspend, (int __user *)arg); if (!error) data->ready = 1; break; @@ -219,6 +230,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, data->ready = 0; break; + case SNAPSHOT_PREF_IMAGE_SIZE: case SNAPSHOT_SET_IMAGE_SIZE: image_size = arg; break; @@ -233,12 +245,14 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, error = put_user(size, (loff_t __user *)arg); break; + case SNAPSHOT_AVAIL_SWAP_SIZE: case SNAPSHOT_AVAIL_SWAP: size = count_swap_pages(data->swap, 1); size <<= PAGE_SHIFT; error = put_user(size, (loff_t __user *)arg); break; + case SNAPSHOT_ALLOC_SWAP_PAGE: case SNAPSHOT_GET_SWAP_PAGE: if (data->swap < 0 || data->swap >= MAX_SWAPFILES) { error = -ENODEV; @@ -247,7 +261,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, offset = alloc_swapdev_block(data->swap); if (offset) { offset <<= PAGE_SHIFT; - error = put_user(offset, (sector_t __user *)arg); + error = put_user(offset, (loff_t __user *)arg); } else { error = -ENOSPC; } -- cgit v1.2.3 From 3010f8caa48ed38679cc32b0d8e84b82cb8d9980 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 26 Oct 2007 01:05:05 +0200 Subject: Hibernation: Introduce exportable suspend ioctls header (rev. 2) Move the definitions of hibernation ioctls to a separate header file in include/linux, which can be exported to the user space. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/power.h | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'kernel') diff --git a/kernel/power/power.h b/kernel/power/power.h index 0dd66fabd393..ef9060576a40 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -1,4 +1,5 @@ #include +#include #include struct swsusp_info { @@ -134,34 +135,6 @@ extern int snapshot_write_next(struct snapshot_handle *handle, size_t count); extern void snapshot_write_finalize(struct snapshot_handle *handle); extern int snapshot_image_loaded(struct snapshot_handle *handle); -/* - * This structure is used to pass the values needed for the identification - * of the resume swap area from a user space to the kernel via the - * SNAPSHOT_SET_SWAP_AREA ioctl - */ -struct resume_swap_area { - loff_t offset; - u_int32_t dev; -} __attribute__((packed)); - -#define SNAPSHOT_IOC_MAGIC '3' -#define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1) -#define SNAPSHOT_UNFREEZE _IO(SNAPSHOT_IOC_MAGIC, 2) -#define SNAPSHOT_ATOMIC_RESTORE _IO(SNAPSHOT_IOC_MAGIC, 4) -#define SNAPSHOT_FREE _IO(SNAPSHOT_IOC_MAGIC, 5) -#define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) -#define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) -#define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ - struct resume_swap_area) -#define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t) -#define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15) -#define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16) -#define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int) -#define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18) -#define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, loff_t) -#define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, loff_t) -#define SNAPSHOT_IOC_MAXNR 20 - /* If unset, the snapshot device cannot be open. */ extern atomic_t snapshot_device_available; -- cgit v1.2.3 From 2f8ed1c60b06b797bf79a1dc540f0bed8c9d75a0 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 19 Nov 2007 23:36:20 +0100 Subject: Hibernation: Move function prototypes to header This patch moves the prototypes of count_highmem_pages() and restore_highmem() to kernel/power/power.h Signed-off-by: Adrian Bunk Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- kernel/power/power.h | 8 ++++++++ kernel/power/snapshot.c | 1 - kernel/power/swsusp.c | 8 -------- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'kernel') diff --git a/kernel/power/power.h b/kernel/power/power.h index ef9060576a40..c5321eb1f7c8 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -180,3 +180,11 @@ static inline int pm_notifier_call_chain(unsigned long val) return (blocking_notifier_call_chain(&pm_chain_head, val, NULL) == NOTIFY_BAD) ? -EINVAL : 0; } + +#ifdef CONFIG_HIGHMEM +unsigned int count_highmem_pages(void); +int restore_highmem(void); +#else +static inline unsigned int count_highmem_pages(void) { return 0; } +static inline int restore_highmem(void) { return 0; } +#endif diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index c5ce0f34a5d4..1ec3eccb1a34 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -872,7 +872,6 @@ unsigned int count_highmem_pages(void) } #else static inline void *saveable_highmem_page(unsigned long pfn) { return NULL; } -static inline unsigned int count_highmem_pages(void) { return 0; } #endif /* CONFIG_HIGHMEM */ /** diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index e1722d3155f1..605c536795ba 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -64,14 +64,6 @@ unsigned long image_size = 500 * 1024 * 1024; int in_suspend __nosavedata = 0; -#ifdef CONFIG_HIGHMEM -unsigned int count_highmem_pages(void); -int restore_highmem(void); -#else -static inline int restore_highmem(void) { return 0; } -static inline unsigned int count_highmem_pages(void) { return 0; } -#endif - /** * The following functions are used for tracing the allocated * swap pages, so that they can be freed in case of an error. -- cgit v1.2.3 From c3e94d899c864e558f938f9845ddb8c2e5d5ccd0 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 19 Nov 2007 23:38:25 +0100 Subject: Hibernation: Add PM_RESTORE_PREPARE and PM_POST_RESTORE notifiers (rev. 2) Add PM_RESTORE_PREPARE and PM_POST_RESTORE notifiers to the PM core, to be used in analogy with the existing PM_HIBERNATION_PREPARE and PM_POST_HIBERNATION notifiers. Signed-off-by: Alan Stern Acked-by: Pavel Machek Signed-off-by: "Rafael J. Wysocki" Signed-off-by: Len Brown --- kernel/power/disk.c | 5 +++++ kernel/power/user.c | 31 +++++++++++++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) (limited to 'kernel') diff --git a/kernel/power/disk.c b/kernel/power/disk.c index b138b431e271..659736508239 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c @@ -499,6 +499,10 @@ static int software_resume(void) goto Unlock; } + error = pm_notifier_call_chain(PM_RESTORE_PREPARE); + if (error) + goto Finish; + error = create_basic_memory_bitmaps(); if (error) goto Finish; @@ -522,6 +526,7 @@ static int software_resume(void) Done: free_basic_memory_bitmaps(); Finish: + pm_notifier_call_chain(PM_POST_RESTORE); atomic_inc(&snapshot_device_available); /* For success case, the suspend path will release the lock */ Unlock: diff --git a/kernel/power/user.c b/kernel/power/user.c index b902a7e3bd12..f5512cb3aa86 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -67,6 +67,7 @@ atomic_t snapshot_device_available = ATOMIC_INIT(1); static int snapshot_open(struct inode *inode, struct file *filp) { struct snapshot_data *data; + int error; if (!atomic_add_unless(&snapshot_device_available, -1, 0)) return -EBUSY; @@ -87,9 +88,19 @@ static int snapshot_open(struct inode *inode, struct file *filp) data->swap = swsusp_resume_device ? swap_type_of(swsusp_resume_device, 0, NULL) : -1; data->mode = O_RDONLY; + error = pm_notifier_call_chain(PM_RESTORE_PREPARE); + if (error) + pm_notifier_call_chain(PM_POST_RESTORE); } else { data->swap = -1; data->mode = O_WRONLY; + error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); + if (error) + pm_notifier_call_chain(PM_POST_HIBERNATION); + } + if (error) { + atomic_inc(&snapshot_device_available); + return error; } data->frozen = 0; data->ready = 0; @@ -111,6 +122,8 @@ static int snapshot_release(struct inode *inode, struct file *filp) thaw_processes(); mutex_unlock(&pm_mutex); } + pm_notifier_call_chain(data->mode == O_WRONLY ? + PM_POST_HIBERNATION : PM_POST_RESTORE); atomic_inc(&snapshot_device_available); return 0; } @@ -174,18 +187,13 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, if (data->frozen) break; mutex_lock(&pm_mutex); - error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); - if (!error) { - printk("Syncing filesystems ... "); - sys_sync(); - printk("done.\n"); - - error = freeze_processes(); - if (error) - thaw_processes(); - } + printk("Syncing filesystems ... "); + sys_sync(); + printk("done.\n"); + + error = freeze_processes(); if (error) - pm_notifier_call_chain(PM_POST_HIBERNATION); + thaw_processes(); mutex_unlock(&pm_mutex); if (!error) data->frozen = 1; @@ -196,7 +204,6 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, break; mutex_lock(&pm_mutex); thaw_processes(); - pm_notifier_call_chain(PM_POST_HIBERNATION); mutex_unlock(&pm_mutex); data->frozen = 0; break; -- cgit v1.2.3 From 0e7d56e3d9d7e37c79d0e05ffb3994e34beb3bbc Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 19 Nov 2007 23:41:19 +0100 Subject: Suspend: Testing facility (rev. 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce sysfs attribute /sys/power/pm_test allowing one to test the suspend core code.  Namely, writing one of the strings: freezer devices platform processors core to this file causes the suspend code to work in one of the test modes defined as follows: freezer - test the freezing of processes devices - test the freezing of processes and suspending of devices platform - test the freezing of processes, suspending of devices and platform global   control methods(*) processors - test the freezing of processes, suspending of devices, platform global   control methods and the disabling of nonboot CPUs core - test the freezing of processes, suspending of devices, platform global   control methods, the disabling of nonboot CPUs and suspending of   platform/system devices (*) These are ACPI global control methods on ACPI systems Then, if a suspend is started by normal means, the suspend core will perform its normal operations up to the point indicated by given test level.  Next, it will wait for 5 seconds and carry out the resume operations needed to transition the system back to the fully functional state. Writing "none" to /sys/power/pm_test turns the testing off. When open for reading, /sys/power/pm_test contains a space-separated list of all available tests (including "none" that represents the normal functionality) in which the current test level is indicated by square brackets. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/main.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++----- kernel/power/power.h | 18 +++++++++ 2 files changed, 117 insertions(+), 9 deletions(-) (limited to 'kernel') diff --git a/kernel/power/main.c b/kernel/power/main.c index efc08360e627..84e1ae63bb8c 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -31,6 +31,79 @@ DEFINE_MUTEX(pm_mutex); unsigned int pm_flags; EXPORT_SYMBOL(pm_flags); +#ifdef CONFIG_PM_DEBUG +int pm_test_level = TEST_NONE; + +static int suspend_test(int level) +{ + if (pm_test_level == level) { + printk(KERN_INFO "suspend debug: Waiting for 5 seconds.\n"); + mdelay(5000); + return 1; + } + return 0; +} + +static const char * const pm_tests[__TEST_AFTER_LAST] = { + [TEST_NONE] = "none", + [TEST_CORE] = "core", + [TEST_CPUS] = "processors", + [TEST_PLATFORM] = "platform", + [TEST_DEVICES] = "devices", + [TEST_FREEZER] = "freezer", +}; + +static ssize_t pm_test_show(struct kset *kset, char *buf) +{ + char *s = buf; + int level; + + for (level = TEST_FIRST; level <= TEST_MAX; level++) + if (pm_tests[level]) { + if (level == pm_test_level) + s += sprintf(s, "[%s] ", pm_tests[level]); + else + s += sprintf(s, "%s ", pm_tests[level]); + } + + if (s != buf) + /* convert the last space to a newline */ + *(s-1) = '\n'; + + return (s - buf); +} + +static ssize_t pm_test_store(struct kset *kset, const char *buf, size_t n) +{ + const char * const *s; + int level; + char *p; + int len; + int error = -EINVAL; + + p = memchr(buf, '\n', n); + len = p ? p - buf : n; + + mutex_lock(&pm_mutex); + + level = TEST_FIRST; + for (s = &pm_tests[level]; level <= TEST_MAX; s++, level++) + if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) { + pm_test_level = level; + error = 0; + break; + } + + mutex_unlock(&pm_mutex); + + return error ? error : n; +} + +power_attr(pm_test); +#else /* !CONFIG_PM_DEBUG */ +static inline int suspend_test(int level) { return 0; } +#endif /* !CONFIG_PM_DEBUG */ + #ifdef CONFIG_SUSPEND /* This is just an arbitrary number */ @@ -136,7 +209,10 @@ static int suspend_enter(suspend_state_t state) printk(KERN_ERR "Some devices failed to power down\n"); goto Done; } - error = suspend_ops->enter(state); + + if (!suspend_test(TEST_CORE)) + error = suspend_ops->enter(state); + device_power_up(); Done: arch_suspend_enable_irqs(); @@ -167,16 +243,25 @@ int suspend_devices_and_enter(suspend_state_t state) printk(KERN_ERR "Some devices failed to suspend\n"); goto Resume_console; } + + if (suspend_test(TEST_DEVICES)) + goto Resume_devices; + if (suspend_ops->prepare) { error = suspend_ops->prepare(); if (error) goto Resume_devices; } + + if (suspend_test(TEST_PLATFORM)) + goto Finish; + error = disable_nonboot_cpus(); - if (!error) + if (!error && !suspend_test(TEST_CPUS)) suspend_enter(state); enable_nonboot_cpus(); + Finish: if (suspend_ops->finish) suspend_ops->finish(); Resume_devices: @@ -243,12 +328,17 @@ static int enter_state(suspend_state_t state) printk("done.\n"); pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]); - if ((error = suspend_prepare())) + error = suspend_prepare(); + if (error) goto Unlock; + if (suspend_test(TEST_FREEZER)) + goto Finish; + pr_debug("PM: Entering %s sleep\n", pm_states[state]); error = suspend_devices_and_enter(state); + Finish: pr_debug("PM: Finishing wakeup.\n"); suspend_finish(); Unlock: @@ -369,18 +459,18 @@ pm_trace_store(struct kobject *kobj, struct kobj_attribute *attr, } power_attr(pm_trace); +#endif /* CONFIG_PM_TRACE */ static struct attribute * g[] = { &state_attr.attr, +#ifdef CONFIG_PM_TRACE &pm_trace_attr.attr, +#endif +#ifdef CONFIG_PM_DEBUG + &pm_test_attr.attr, +#endif NULL, }; -#else -static struct attribute * g[] = { - &state_attr.attr, - NULL, -}; -#endif /* CONFIG_PM_TRACE */ static struct attribute_group attr_group = { .attrs = g, diff --git a/kernel/power/power.h b/kernel/power/power.h index c5321eb1f7c8..9f9e16e33962 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -188,3 +188,21 @@ int restore_highmem(void); static inline unsigned int count_highmem_pages(void) { return 0; } static inline int restore_highmem(void) { return 0; } #endif + +/* + * Suspend test levels + */ +enum { + /* keep first */ + TEST_NONE, + TEST_CORE, + TEST_CPUS, + TEST_PLATFORM, + TEST_DEVICES, + TEST_FREEZER, + /* keep last */ + __TEST_AFTER_LAST +}; + +#define TEST_FIRST TEST_NONE +#define TEST_MAX (__TEST_AFTER_LAST - 1) -- cgit v1.2.3 From 039a75c6e17ba4ff76998d6ac6ee3d508fff1930 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 29 Jan 2008 00:29:06 +0100 Subject: suspend: build fix responding to 2.6.25 kset change Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- kernel/power/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/power/main.c b/kernel/power/main.c index 84e1ae63bb8c..fc717b836828 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -53,7 +53,8 @@ static const char * const pm_tests[__TEST_AFTER_LAST] = { [TEST_FREEZER] = "freezer", }; -static ssize_t pm_test_show(struct kset *kset, char *buf) +static ssize_t pm_test_show(struct kobject *kobj, struct kobj_attribute *attr, + char *buf) { char *s = buf; int level; @@ -73,7 +74,8 @@ static ssize_t pm_test_show(struct kset *kset, char *buf) return (s - buf); } -static ssize_t pm_test_store(struct kset *kset, const char *buf, size_t n) +static ssize_t pm_test_store(struct kobject *kobj, struct kobj_attribute *attr, + const char *buf, size_t n) { const char * const *s; int level; @@ -104,6 +106,7 @@ power_attr(pm_test); static inline int suspend_test(int level) { return 0; } #endif /* !CONFIG_PM_DEBUG */ + #ifdef CONFIG_SUSPEND /* This is just an arbitrary number */ -- cgit v1.2.3 From 4cc79776c9ea431790e04fcacbebb30d28eb1570 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 19 Nov 2007 23:42:31 +0100 Subject: Hibernation: New testing facility (rev. 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make it possible to test the hibernation core code with the help of the /sys/power/pm_test attribute introduced for suspend testing in the previous patch. Writing an appropriate string to this file causes the hibernation code to work in one of the test modes defined as follows: freezer - test the freezing of processes devices - test the freezing of processes and suspending of devices platform - test the freezing of processes, suspending of devices and platform global   control methods(*) processors - test the freezing of processes, suspending of devices, platform global   control methods(*) and the disabling of nonboot CPUs core - test the freezing of processes, suspending of devices, platform global   control methods(*), the disabling of nonboot CPUs and suspending of   platform/system devices (*) - the platform global control methods are only available on ACPI systems       and are only tested if the hibernation mode is set to "platform" Then, if a hibernation is started by normal means, the hibernation core will perform its normal operations up to the point indicated by given test level. Next, it will wait for 5 seconds and carry out the resume operations needed to transition the system back to the fully functional state. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/disk.c | 70 +++++++++++++++++++++++++++++++++++++++++----------- kernel/power/power.h | 2 ++ 2 files changed, 57 insertions(+), 15 deletions(-) (limited to 'kernel') diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 659736508239..0866b163c6bb 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c @@ -70,6 +70,35 @@ void hibernation_set_ops(struct platform_hibernation_ops *ops) mutex_unlock(&pm_mutex); } +#ifdef CONFIG_PM_DEBUG +static void hibernation_debug_sleep(void) +{ + printk(KERN_INFO "hibernation debug: Waiting for 5 seconds.\n"); + mdelay(5000); +} + +static int hibernation_testmode(int mode) +{ + if (hibernation_mode == mode) { + hibernation_debug_sleep(); + return 1; + } + return 0; +} + +static int hibernation_test(int level) +{ + if (pm_test_level == level) { + hibernation_debug_sleep(); + return 1; + } + return 0; +} +#else /* !CONFIG_PM_DEBUG */ +static int hibernation_testmode(int mode) { return 0; } +static int hibernation_test(int level) { return 0; } +#endif /* !CONFIG_PM_DEBUG */ + /** * platform_start - tell the platform driver that we're starting * hibernation @@ -167,6 +196,10 @@ int create_image(int platform_mode) goto Enable_irqs; } + if (hibernation_test(TEST_CORE)) + goto Power_up; + + in_suspend = 1; save_processor_state(); error = swsusp_arch_suspend(); if (error) @@ -175,6 +208,7 @@ int create_image(int platform_mode) restore_processor_state(); if (!in_suspend) platform_leave(platform_mode); + Power_up: /* NOTE: device_power_up() is just a resume() for devices * that suspended with irqs off ... no overall powerup. */ @@ -211,24 +245,29 @@ int hibernation_snapshot(int platform_mode) if (error) goto Resume_console; - error = platform_pre_snapshot(platform_mode); - if (error) + if (hibernation_test(TEST_DEVICES)) goto Resume_devices; + error = platform_pre_snapshot(platform_mode); + if (error || hibernation_test(TEST_PLATFORM)) + goto Finish; + error = disable_nonboot_cpus(); if (!error) { - if (hibernation_mode != HIBERNATION_TEST) { - in_suspend = 1; - error = create_image(platform_mode); - /* Control returns here after successful restore */ - } else { - printk("swsusp debug: Waiting for 5 seconds.\n"); - mdelay(5000); - } + if (hibernation_test(TEST_CPUS)) + goto Enable_cpus; + + if (hibernation_testmode(HIBERNATION_TEST)) + goto Enable_cpus; + + error = create_image(platform_mode); + /* Control returns here after successful restore */ } + Enable_cpus: enable_nonboot_cpus(); - Resume_devices: + Finish: platform_finish(platform_mode); + Resume_devices: device_resume(); Resume_console: resume_console(); @@ -406,11 +445,12 @@ int hibernate(void) if (error) goto Finish; - if (hibernation_mode == HIBERNATION_TESTPROC) { - printk("swsusp debug: Waiting for 5 seconds.\n"); - mdelay(5000); + if (hibernation_test(TEST_FREEZER)) goto Thaw; - } + + if (hibernation_testmode(HIBERNATION_TESTPROC)) + goto Thaw; + error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM); if (in_suspend && !error) { unsigned int flags = 0; diff --git a/kernel/power/power.h b/kernel/power/power.h index 9f9e16e33962..f9f0d4d26c50 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -206,3 +206,5 @@ enum { #define TEST_FIRST TEST_NONE #define TEST_MAX (__TEST_AFTER_LAST - 1) + +extern int pm_test_level; -- cgit v1.2.3 From 90dda1cb6ace6abd777f84bf051c4f86fa58986a Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 19 Nov 2007 23:46:16 +0100 Subject: PM: Make PM_TRACE more architecture independent When trying to debug a suspend failure I started implementing PM_TRACE for powerpc. I then noticed that I'm debugging a suspend failure and so PM_TRACE isn't useful at all, but thought that nonetheless this could be useful in the future. Basically, to support PM_TRACE, you add a Kconfig option that selects PM_TRACE and provides the infrastructure as per the help text of PM_TRACE. Signed-off-by: Johannes Berg Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- kernel/power/Kconfig | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 8e186c678149..06a08f7cebda 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -44,9 +44,30 @@ config PM_VERBOSE ---help--- This option enables verbose messages from the Power Management code. +config CAN_PM_TRACE + def_bool y + depends on PM_DEBUG && PM_SLEEP && EXPERIMENTAL + config PM_TRACE + bool + help + This enables code to save the last PM event point across + reboot. The architecture needs to support this, x86 for + example does by saving things in the RTC, see below. + + The architecture specific code must provide the extern + functions from as well as the + header with a TRACE_RESUME() macro. + + The way the information is presented is architecture- + dependent, x86 will print the information during a + late_initcall. + +config PM_TRACE_RTC bool "Suspend/resume event tracing" - depends on PM_DEBUG && X86 && PM_SLEEP && EXPERIMENTAL + depends on CAN_PM_TRACE + depends on X86 + select PM_TRACE default n ---help--- This enables some cheesy code to save the last PM event point in the -- cgit v1.2.3 From 825257569350e913bee3bc918508c0aa6e3398cd Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 19 Nov 2007 23:49:18 +0100 Subject: PM: Convert PM notifiers to out-of-line code This patch (as1008b) converts the PM notifier routines from inline calls to out-of-line code. It also prevents pm_chain_head from being created when CONFIG_PM_SLEEP isn't enabled, and EXPORTs the notifier registration and unregistration routines. Signed-off-by: Alan Stern Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- kernel/power/main.c | 28 ++++++++++++++++++++++++++-- kernel/power/power.h | 12 ++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) (limited to 'kernel') diff --git a/kernel/power/main.c b/kernel/power/main.c index fc717b836828..0a9f269075ee 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -24,13 +24,37 @@ #include "power.h" -BLOCKING_NOTIFIER_HEAD(pm_chain_head); - DEFINE_MUTEX(pm_mutex); unsigned int pm_flags; EXPORT_SYMBOL(pm_flags); +#ifdef CONFIG_PM_SLEEP + +/* Routines for PM-transition notifications */ + +static BLOCKING_NOTIFIER_HEAD(pm_chain_head); + +int register_pm_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&pm_chain_head, nb); +} +EXPORT_SYMBOL_GPL(register_pm_notifier); + +int unregister_pm_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_unregister(&pm_chain_head, nb); +} +EXPORT_SYMBOL_GPL(unregister_pm_notifier); + +int pm_notifier_call_chain(unsigned long val) +{ + return (blocking_notifier_call_chain(&pm_chain_head, val, NULL) + == NOTIFY_BAD) ? -EINVAL : 0; +} + +#endif /* CONFIG_PM_SLEEP */ + #ifdef CONFIG_PM_DEBUG int pm_test_level = TEST_NONE; diff --git a/kernel/power/power.h b/kernel/power/power.h index f9f0d4d26c50..a9732fd12239 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -172,14 +172,10 @@ static inline int suspend_devices_and_enter(suspend_state_t state) } #endif /* !CONFIG_SUSPEND */ -/* kernel/power/common.c */ -extern struct blocking_notifier_head pm_chain_head; - -static inline int pm_notifier_call_chain(unsigned long val) -{ - return (blocking_notifier_call_chain(&pm_chain_head, val, NULL) - == NOTIFY_BAD) ? -EINVAL : 0; -} +#ifdef CONFIG_PM_SLEEP +/* kernel/power/main.c */ +extern int pm_notifier_call_chain(unsigned long val); +#endif #ifdef CONFIG_HIGHMEM unsigned int count_highmem_pages(void); -- cgit v1.2.3 From 2ed43b63285c394cb5e1829c199cc94c7b8233b9 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sat, 8 Dec 2007 02:03:26 +0100 Subject: Suspend: Fix compilation warning for CONFIG_SUSPEND unset Suspend: Make debug facility depend on CONFIG_SUSPEND Make the new suspend debug facility code depend on CONFIG_SUSPEND, as appropriate, to remove the compiler warning printed when CONFIG_PM is set and CONFIG_SUSPEND is not set. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kernel') diff --git a/kernel/power/main.c b/kernel/power/main.c index 0a9f269075ee..7fb805de19a8 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -55,6 +55,8 @@ int pm_notifier_call_chain(unsigned long val) #endif /* CONFIG_PM_SLEEP */ +#ifdef CONFIG_SUSPEND + #ifdef CONFIG_PM_DEBUG int pm_test_level = TEST_NONE; -- cgit v1.2.3 From 72df68ca8e006a0107933c4fb13c741a0a48163f Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sat, 8 Dec 2007 02:04:21 +0100 Subject: Hibernation: Move low level resume to disk.c Move the low level restore code to kernel/power/disk.c , since the corresponding low level hibernation code is already there. Make restore fail if device_power_down(PMSG_PRETHAW) returns an error. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/disk.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- kernel/power/power.h | 1 - kernel/power/swsusp.c | 35 ----------------------------------- 3 files changed, 48 insertions(+), 37 deletions(-) (limited to 'kernel') diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 0866b163c6bb..2a4bada184ed 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c @@ -274,6 +274,53 @@ int hibernation_snapshot(int platform_mode) return error; } +/** + * resume_target_kernel - prepare devices that need to be suspended with + * interrupts off, restore the contents of highmem that have not been + * restored yet from the image and run the low level code that will restore + * the remaining contents of memory and switch to the just restored target + * kernel. + */ + +static int resume_target_kernel(void) +{ + int error; + + local_irq_disable(); + error = device_power_down(PMSG_PRETHAW); + if (error) { + printk(KERN_ERR "Some devices failed to power down, " + "aborting resume\n"); + goto Enable_irqs; + } + /* We'll ignore saved state, but this gets preempt count (etc) right */ + save_processor_state(); + error = restore_highmem(); + if (!error) { + error = swsusp_arch_resume(); + /* + * The code below is only ever reached in case of a failure. + * Otherwise execution continues at place where + * swsusp_arch_suspend() was called + */ + BUG_ON(!error); + /* This call to restore_highmem() undos the previous one */ + restore_highmem(); + } + /* + * The only reason why swsusp_arch_resume() can fail is memory being + * very tight, so we have to free it as soon as we can to avoid + * subsequent failures + */ + swsusp_free(); + restore_processor_state(); + touch_softlockup_watchdog(); + device_power_up(); + Enable_irqs: + local_irq_enable(); + return error; +} + /** * hibernation_restore - quiesce devices and restore the hibernation * snapshot image. If successful, control returns in hibernation_snaphot() @@ -297,7 +344,7 @@ int hibernation_restore(int platform_mode) if (!error) { error = disable_nonboot_cpus(); if (!error) - error = swsusp_resume(); + error = resume_target_kernel(); enable_nonboot_cpus(); } platform_restore_cleanup(platform_mode); diff --git a/kernel/power/power.h b/kernel/power/power.h index a9732fd12239..8ec5499c5ce1 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -152,7 +152,6 @@ extern int swsusp_swap_in_use(void); extern int swsusp_check(void); extern int swsusp_shrink_memory(void); extern void swsusp_free(void); -extern int swsusp_resume(void); extern int swsusp_read(unsigned int *flags_p); extern int swsusp_write(unsigned int flags); extern void swsusp_close(void); diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 605c536795ba..dc29a20aff41 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -261,38 +261,3 @@ int swsusp_shrink_memory(void) return 0; } - -int swsusp_resume(void) -{ - int error; - - local_irq_disable(); - /* NOTE: device_power_down() is just a suspend() with irqs off; - * it has no special "power things down" semantics - */ - if (device_power_down(PMSG_PRETHAW)) - printk(KERN_ERR "Some devices failed to power down, very bad\n"); - /* We'll ignore saved state, but this gets preempt count (etc) right */ - save_processor_state(); - error = restore_highmem(); - if (!error) { - error = swsusp_arch_resume(); - /* The code below is only ever reached in case of a failure. - * Otherwise execution continues at place where - * swsusp_arch_suspend() was called - */ - BUG_ON(!error); - /* This call to restore_highmem() undos the previous one */ - restore_highmem(); - } - /* The only reason why swsusp_arch_resume() can fail is memory being - * very tight, so we have to free it as soon as we can to avoid - * subsequent failures - */ - swsusp_free(); - restore_processor_state(); - touch_softlockup_watchdog(); - device_power_up(); - local_irq_enable(); - return error; -} -- cgit v1.2.3 From 9628c0ee6a6d9ef06a77ea25932c00817f9e88a0 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sat, 8 Dec 2007 02:06:00 +0100 Subject: Suspend: Fix comment in main.c Fix a comment in kernel/power/main.c so that it doesn't contain lines longer that 80 characters. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/power/main.c b/kernel/power/main.c index 7fb805de19a8..d0cedaa7edf1 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -250,8 +250,8 @@ static int suspend_enter(suspend_state_t state) } /** - * suspend_devices_and_enter - suspend devices and enter the desired system sleep - * state. + * suspend_devices_and_enter - suspend devices and enter the desired system + * sleep state. * @state: state to enter */ int suspend_devices_and_enter(suspend_state_t state) -- cgit v1.2.3 From 9575809c6fc15e7b6bb1932b6104c80a6d4ffdc9 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sat, 8 Dec 2007 02:06:57 +0100 Subject: Hibernation: Fix comment in disk.c Fix a comment in kernel/power/disk.c so that it doesn't contain lines longer that 80 characters. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/disk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 2a4bada184ed..3e24a200f1d4 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c @@ -568,8 +568,8 @@ static int software_resume(void) if (noresume) { /** - * FIXME: If noresume is specified, we need to find the partition - * and reset it back to normal swap space. + * FIXME: If noresume is specified, we need to find the + * partition and reset it back to normal swap space. */ mutex_unlock(&pm_mutex); return 0; -- cgit v1.2.3 From b6887a29441ed5f0728b31ce90c0f0a0427317a3 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sat, 8 Dec 2007 02:07:40 +0100 Subject: Hibernation: Remove unnecessary variable declaration Remove the unnecessary extern declaration of resume_file[] from kernel/power/swap.c . Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/swap.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'kernel') diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 917aba100575..ef41440879ba 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -28,8 +28,6 @@ #include "power.h" -extern char resume_file[]; - #define SWSUSP_SIG "S1SUSPEND" struct swsusp_header { -- cgit v1.2.3 From 465d2b477f6a0ffe01242561a93e7bf81d67c776 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sat, 8 Dec 2007 02:08:38 +0100 Subject: Suspend: Use common prefix in messages Make suspend messages start with one common prefix "PM: ". Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kernel') diff --git a/kernel/power/main.c b/kernel/power/main.c index d0cedaa7edf1..56881681f18b 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -235,7 +235,7 @@ static int suspend_enter(suspend_state_t state) BUG_ON(!irqs_disabled()); if ((error = device_power_down(PMSG_SUSPEND))) { - printk(KERN_ERR "Some devices failed to power down\n"); + printk(KERN_ERR "PM: Some devices failed to power down\n"); goto Done; } @@ -269,7 +269,7 @@ int suspend_devices_and_enter(suspend_state_t state) suspend_console(); error = device_suspend(PMSG_SUSPEND); if (error) { - printk(KERN_ERR "Some devices failed to suspend\n"); + printk(KERN_ERR "PM: Some devices failed to suspend\n"); goto Resume_console; } @@ -352,7 +352,7 @@ static int enter_state(suspend_state_t state) if (!mutex_trylock(&pm_mutex)) return -EBUSY; - printk("Syncing filesystems ... "); + printk(KERN_INFO "PM: Syncing filesystems ... "); sys_sync(); printk("done.\n"); -- cgit v1.2.3 From 23976728a48c3b76d34e17ead19addd52b3a280e Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sat, 8 Dec 2007 02:09:43 +0100 Subject: Hibernation: Update messages Make hibernation messages start with one common prefix "PM: " and use the word "hibernation" in the messages as a synonym of "suspend to disk". Turn some KERN_INFO messages into debug ones. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Len Brown --- kernel/power/disk.c | 28 +++++++++++++++------------- kernel/power/snapshot.c | 23 ++++++++++++----------- kernel/power/swap.c | 31 +++++++++++++++++-------------- kernel/power/swsusp.c | 5 +++-- 4 files changed, 47 insertions(+), 40 deletions(-) (limited to 'kernel') diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 3e24a200f1d4..64e42ab8b57c 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c @@ -191,8 +191,8 @@ int create_image(int platform_mode) */ error = device_power_down(PMSG_FREEZE); if (error) { - printk(KERN_ERR "Some devices failed to power down, " - KERN_ERR "aborting suspend\n"); + printk(KERN_ERR "PM: Some devices failed to power down, " + "aborting hibernation\n"); goto Enable_irqs; } @@ -203,7 +203,8 @@ int create_image(int platform_mode) save_processor_state(); error = swsusp_arch_suspend(); if (error) - printk(KERN_ERR "Error %d while creating the image\n", error); + printk(KERN_ERR "PM: Error %d creating hibernation image\n", + error); /* Restore control flow magically appears here */ restore_processor_state(); if (!in_suspend) @@ -289,7 +290,7 @@ static int resume_target_kernel(void) local_irq_disable(); error = device_power_down(PMSG_PRETHAW); if (error) { - printk(KERN_ERR "Some devices failed to power down, " + printk(KERN_ERR "PM: Some devices failed to power down, " "aborting resume\n"); goto Enable_irqs; } @@ -438,7 +439,7 @@ static void power_down(void) * Valid image is on the disk, if we continue we risk serious data * corruption after resume. */ - printk(KERN_CRIT "Please power me down manually\n"); + printk(KERN_CRIT "PM: Please power down manually\n"); while(1); } @@ -484,7 +485,7 @@ int hibernate(void) if (error) goto Exit; - printk("Syncing filesystems ... "); + printk(KERN_INFO "PM: Syncing filesystems ... "); sys_sync(); printk("done.\n"); @@ -560,10 +561,11 @@ static int software_resume(void) return -ENOENT; } swsusp_resume_device = name_to_dev_t(resume_file); - pr_debug("swsusp: Resume From Partition %s\n", resume_file); + pr_debug("PM: Resume from partition %s\n", resume_file); } else { - pr_debug("swsusp: Resume From Partition %d:%d\n", - MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device)); + pr_debug("PM: Resume from partition %d:%d\n", + MAJOR(swsusp_resume_device), + MINOR(swsusp_resume_device)); } if (noresume) { @@ -575,7 +577,7 @@ static int software_resume(void) return 0; } - pr_debug("PM: Checking swsusp image.\n"); + pr_debug("PM: Checking hibernation image.\n"); error = swsusp_check(); if (error) goto Unlock; @@ -601,7 +603,7 @@ static int software_resume(void) goto Done; } - pr_debug("PM: Reading swsusp image.\n"); + pr_debug("PM: Reading hibernation image.\n"); error = swsusp_read(&flags); if (!error) @@ -728,7 +730,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, error = -EINVAL; if (!error) - pr_debug("PM: suspend-to-disk mode set to '%s'\n", + pr_debug("PM: Hibernation mode set to '%s'\n", hibernation_modes[mode]); mutex_unlock(&pm_mutex); return error ? error : n; @@ -760,7 +762,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr, mutex_lock(&pm_mutex); swsusp_resume_device = res; mutex_unlock(&pm_mutex); - printk("Attempting manual resume\n"); + printk(KERN_INFO "PM: Starting manual resume from disk\n"); noresume = 0; software_resume(); ret = n; diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 1ec3eccb1a34..f6a5df934f8d 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -635,7 +635,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, region->end_pfn = end_pfn; list_add_tail(®ion->list, &nosave_regions); Report: - printk("swsusp: Registered nosave memory region: %016lx - %016lx\n", + printk(KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n", start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); } @@ -704,7 +704,7 @@ static void mark_nosave_pages(struct memory_bitmap *bm) list_for_each_entry(region, &nosave_regions, list) { unsigned long pfn; - printk("swsusp: Marking nosave pages: %016lx - %016lx\n", + pr_debug("PM: Marking nosave pages: %016lx - %016lx\n", region->start_pfn << PAGE_SHIFT, region->end_pfn << PAGE_SHIFT); @@ -749,7 +749,7 @@ int create_basic_memory_bitmaps(void) free_pages_map = bm2; mark_nosave_pages(forbidden_pages_map); - printk("swsusp: Basic memory bitmaps created\n"); + pr_debug("PM: Basic memory bitmaps created\n"); return 0; @@ -784,7 +784,7 @@ void free_basic_memory_bitmaps(void) memory_bm_free(bm2, PG_UNSAFE_CLEAR); kfree(bm2); - printk("swsusp: Basic memory bitmaps freed\n"); + pr_debug("PM: Basic memory bitmaps freed\n"); } /** @@ -1088,7 +1088,7 @@ static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem) } nr_pages += count_pages_for_highmem(nr_highmem); - pr_debug("swsusp: Normal pages needed: %u + %u + %u, available pages: %u\n", + pr_debug("PM: Normal pages needed: %u + %u + %u, available pages: %u\n", nr_pages, PAGES_FOR_IO, meta, free); return free > nr_pages + PAGES_FOR_IO + meta; @@ -1201,20 +1201,20 @@ asmlinkage int swsusp_save(void) { unsigned int nr_pages, nr_highmem; - printk("swsusp: critical section: \n"); + printk(KERN_INFO "PM: Creating hibernation image: \n"); drain_local_pages(); nr_pages = count_data_pages(); nr_highmem = count_highmem_pages(); - printk("swsusp: Need to copy %u pages\n", nr_pages + nr_highmem); + printk(KERN_INFO "PM: Need to copy %u pages\n", nr_pages + nr_highmem); if (!enough_free_mem(nr_pages, nr_highmem)) { - printk(KERN_ERR "swsusp: Not enough free memory\n"); + printk(KERN_ERR "PM: Not enough free memory\n"); return -ENOMEM; } if (swsusp_alloc(&orig_bm, ©_bm, nr_pages, nr_highmem)) { - printk(KERN_ERR "swsusp: Memory allocation failed\n"); + printk(KERN_ERR "PM: Memory allocation failed\n"); return -ENOMEM; } @@ -1234,7 +1234,8 @@ asmlinkage int swsusp_save(void) nr_copy_pages = nr_pages; nr_meta_pages = DIV_ROUND_UP(nr_pages * sizeof(long), PAGE_SIZE); - printk("swsusp: critical section: done (%d pages copied)\n", nr_pages); + printk(KERN_INFO "PM: Hibernation image created (%d pages copied)\n", + nr_pages); return 0; } @@ -1433,7 +1434,7 @@ static int check_header(struct swsusp_info *info) if (!reason && info->num_physpages != num_physpages) reason = "memory size"; if (reason) { - printk(KERN_ERR "swsusp: Resume mismatch: %s\n", reason); + printk(KERN_ERR "PM: Image mismatch: %s\n", reason); return -EPERM; } return 0; diff --git a/kernel/power/swap.c b/kernel/power/swap.c index ef41440879ba..a0abf9a463f9 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -71,7 +71,8 @@ static int submit(int rw, pgoff_t page_off, struct page *page, bio->bi_end_io = end_swap_bio_read; if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { - printk("swsusp: ERROR: adding page to bio at %ld\n", page_off); + printk(KERN_ERR "PM: Adding page to bio failed at %ld\n", + page_off); bio_put(bio); return -EFAULT; } @@ -151,7 +152,7 @@ static int mark_swapfiles(sector_t start, unsigned int flags) error = bio_write_page(swsusp_resume_block, swsusp_header, NULL); } else { - printk(KERN_ERR "swsusp: Swap header not found!\n"); + printk(KERN_ERR "PM: Swap header not found!\n"); error = -ENODEV; } return error; @@ -323,7 +324,8 @@ static int save_image(struct swap_map_handle *handle, struct timeval start; struct timeval stop; - printk("Saving image data pages (%u pages) ... ", nr_to_write); + printk(KERN_INFO "PM: Saving image data pages (%u pages) ... ", + nr_to_write); m = nr_to_write / 100; if (!m) m = 1; @@ -363,7 +365,7 @@ static int enough_swap(unsigned int nr_pages) { unsigned int free_swap = count_swap_pages(root_swap, 1); - pr_debug("swsusp: free swap pages: %u\n", free_swap); + pr_debug("PM: Free swap pages: %u\n", free_swap); return free_swap > nr_pages + PAGES_FOR_IO; } @@ -386,7 +388,7 @@ int swsusp_write(unsigned int flags) error = swsusp_swap_check(); if (error) { - printk(KERN_ERR "swsusp: Cannot find swap device, try " + printk(KERN_ERR "PM: Cannot find swap device, try " "swapon -a.\n"); return error; } @@ -400,7 +402,7 @@ int swsusp_write(unsigned int flags) } header = (struct swsusp_info *)data_of(snapshot); if (!enough_swap(header->pages)) { - printk(KERN_ERR "swsusp: Not enough free swap\n"); + printk(KERN_ERR "PM: Not enough free swap\n"); error = -ENOSPC; goto out; } @@ -415,7 +417,7 @@ int swsusp_write(unsigned int flags) if (!error) { flush_swap_writer(&handle); - printk("S"); + printk(KERN_INFO "PM: S"); error = mark_swapfiles(start, flags); printk("|\n"); } @@ -505,7 +507,8 @@ static int load_image(struct swap_map_handle *handle, int err2; unsigned nr_pages; - printk("Loading image data pages (%u pages) ... ", nr_to_read); + printk(KERN_INFO "PM: Loading image data pages (%u pages) ... ", + nr_to_read); m = nr_to_read / 100; if (!m) m = 1; @@ -556,7 +559,7 @@ int swsusp_read(unsigned int *flags_p) *flags_p = swsusp_header->flags; if (IS_ERR(resume_bdev)) { - pr_debug("swsusp: block device not initialised\n"); + pr_debug("PM: Image device not initialised\n"); return PTR_ERR(resume_bdev); } @@ -575,9 +578,9 @@ int swsusp_read(unsigned int *flags_p) blkdev_put(resume_bdev); if (!error) - pr_debug("swsusp: Reading resume file was successful\n"); + pr_debug("PM: Image successfully loaded\n"); else - pr_debug("swsusp: Error %d resuming\n", error); + pr_debug("PM: Error %d resuming\n", error); return error; } @@ -609,13 +612,13 @@ int swsusp_check(void) if (error) blkdev_put(resume_bdev); else - pr_debug("swsusp: Signature found, resuming\n"); + pr_debug("PM: Signature found, resuming\n"); } else { error = PTR_ERR(resume_bdev); } if (error) - pr_debug("swsusp: Error %d check for resume file\n", error); + pr_debug("PM: Error %d checking image file\n", error); return error; } @@ -627,7 +630,7 @@ int swsusp_check(void) void swsusp_close(void) { if (IS_ERR(resume_bdev)) { - pr_debug("swsusp: block device not initialised\n"); + pr_debug("PM: Image device not initialised\n"); return; } diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index dc29a20aff41..023ff2a31d89 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -188,7 +188,8 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop, centisecs = 1; /* avoid div-by-zero */ k = nr_pages * (PAGE_SIZE / 1024); kps = (k * 100) / centisecs; - printk("%s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n", msg, k, + printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n", + msg, k, centisecs / 100, centisecs % 100, kps / 1000, (kps % 1000) / 10); } @@ -219,7 +220,7 @@ int swsusp_shrink_memory(void) char *p = "-\\|/"; struct timeval start, stop; - printk("Shrinking memory... "); + printk(KERN_INFO "PM: Shrinking memory... "); do_gettimeofday(&start); do { long size, highmem_size; -- cgit v1.2.3 From 801e4062fda6496fe9bee3e6915a2aa108f974e5 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 8 Dec 2007 02:12:39 +0100 Subject: Hibernation: Clean up Kconfig (V2) This cleans up the hibernation Kconfig and removes the need to declare centrally which architectures support hibernation. All architectures that currently support hibernation are modified accordingly. Signed-off-by: Johannes Berg Acked-by: Paul Mackerras Cc: Pavel Machek Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- kernel/power/Kconfig | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'kernel') diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 06a08f7cebda..fd76d54910d0 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -84,7 +84,8 @@ config PM_TRACE_RTC config PM_SLEEP_SMP bool - depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE + depends on SMP + depends on SUSPEND_SMP_POSSIBLE || ARCH_HIBERNATION_POSSIBLE depends on PM_SLEEP select HOTPLUG_CPU default y @@ -118,22 +119,9 @@ config SUSPEND powered and thus its contents are preserved, such as the suspend-to-RAM state (i.e. the ACPI S3 state). -config HIBERNATION_UP_POSSIBLE - bool - depends on X86 || PPC64_SWSUSP || PPC32 - depends on !SMP - default y - -config HIBERNATION_SMP_POSSIBLE - bool - depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP - depends on SMP - default y - config HIBERNATION bool "Hibernation (aka 'suspend to disk')" - depends on PM && SWAP - depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE + depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE ---help--- Enable the suspend to disk (STD) functionality, which is usually called "hibernation" in user interfaces. STD checkpoints the -- cgit v1.2.3 From f4cb57007662a4ec3c2de3c027900223e0299bdd Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 8 Dec 2007 02:14:00 +0100 Subject: Suspend: Clean up Kconfig (V2) This cleans up the suspend Kconfig and removes the need to declare centrally which architectures sup