aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-02-21 17:17:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-21 17:17:26 -0500
commitadfafefd104d840ee4461965f22624d77532675b (patch)
tree6c6ba553a2b11703bf5952bd789905ea37c4fc4f /kernel/power
parent460c1338fc05add0e8050d4945a46f207b13a5fc (diff)
parent403f307576396f3362fbb65af190885b6036c72c (diff)
Merge branch 'hibernate'
* hibernate: PM: Fix suspend_console and resume_console to use only one semaphore PM: Wait for console in resume PM: Fix pm_notifiers during user mode hibernation swsusp: clean up shrink_all_zones() swsusp: dont fiddle with swappiness PM: fix build for CONFIG_PM unset PM/hibernate: fix "swap breaks after hibernation failures" PM/resume: wait for device probing to finish Consolidate driver_probe_done() loops into one place
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/console.c6
-rw-r--r--kernel/power/disk.c11
-rw-r--r--kernel/power/user.c8
3 files changed, 21 insertions, 4 deletions
diff --git a/kernel/power/console.c b/kernel/power/console.c
index b8628be2a465..a3961b205de7 100644
--- a/kernel/power/console.c
+++ b/kernel/power/console.c
@@ -78,6 +78,12 @@ void pm_restore_console(void)
78 } 78 }
79 set_console(orig_fgconsole); 79 set_console(orig_fgconsole);
80 release_console_sem(); 80 release_console_sem();
81
82 if (vt_waitactive(orig_fgconsole)) {
83 pr_debug("Resume: Can't switch VCs.");
84 return;
85 }
86
81 kmsg_redirect = orig_kmsg; 87 kmsg_redirect = orig_kmsg;
82} 88}
83#endif 89#endif
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 432ee575c9ee..7b40e94b1d42 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -595,6 +595,12 @@ static int software_resume(void)
595 unsigned int flags; 595 unsigned int flags;
596 596
597 /* 597 /*
598 * If the user said "noresume".. bail out early.
599 */
600 if (noresume)
601 return 0;
602
603 /*
598 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs 604 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
599 * is configured into the kernel. Since the regular hibernate 605 * is configured into the kernel. Since the regular hibernate
600 * trigger path is via sysfs which takes a buffer mutex before 606 * trigger path is via sysfs which takes a buffer mutex before
@@ -610,6 +616,11 @@ static int software_resume(void)
610 mutex_unlock(&pm_mutex); 616 mutex_unlock(&pm_mutex);
611 return -ENOENT; 617 return -ENOENT;
612 } 618 }
619 /*
620 * Some device discovery might still be in progress; we need
621 * to wait for this to finish.
622 */
623 wait_for_device_probe();
613 swsusp_resume_device = name_to_dev_t(resume_file); 624 swsusp_resume_device = name_to_dev_t(resume_file);
614 pr_debug("PM: Resume from partition %s\n", resume_file); 625 pr_debug("PM: Resume from partition %s\n", resume_file);
615 } else { 626 } else {
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 005b93d839ba..6c85359364f2 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -95,15 +95,15 @@ static int snapshot_open(struct inode *inode, struct file *filp)
95 data->swap = swsusp_resume_device ? 95 data->swap = swsusp_resume_device ?
96 swap_type_of(swsusp_resume_device, 0, NULL) : -1; 96 swap_type_of(swsusp_resume_device, 0, NULL) : -1;
97 data->mode = O_RDONLY; 97 data->mode = O_RDONLY;
98 error = pm_notifier_call_chain(PM_RESTORE_PREPARE); 98 error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
99 if (error) 99 if (error)
100 pm_notifier_call_chain(PM_POST_RESTORE); 100 pm_notifier_call_chain(PM_POST_HIBERNATION);
101 } else { 101 } else {
102 data->swap = -1; 102 data->swap = -1;
103 data->mode = O_WRONLY; 103 data->mode = O_WRONLY;
104 error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); 104 error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
105 if (error) 105 if (error)
106 pm_notifier_call_chain(PM_POST_HIBERNATION); 106 pm_notifier_call_chain(PM_POST_RESTORE);
107 } 107 }
108 if (error) 108 if (error)
109 atomic_inc(&snapshot_device_available); 109 atomic_inc(&snapshot_device_available);