aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r--kernel/power/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 540b16b68565..613f16941b85 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -14,6 +14,7 @@
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/kmod.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/console.h> 19#include <linux/console.h>
19#include <linux/cpu.h> 20#include <linux/cpu.h>
@@ -21,7 +22,6 @@
21#include <linux/freezer.h> 22#include <linux/freezer.h>
22#include <linux/vmstat.h> 23#include <linux/vmstat.h>
23#include <linux/syscalls.h> 24#include <linux/syscalls.h>
24#include <linux/ftrace.h>
25 25
26#include "power.h" 26#include "power.h"
27 27
@@ -173,7 +173,7 @@ static void suspend_test_finish(const char *label)
173 * has some performance issues. The stack dump of a WARN_ON 173 * has some performance issues. The stack dump of a WARN_ON
174 * is more likely to get the right attention than a printk... 174 * is more likely to get the right attention than a printk...
175 */ 175 */
176 WARN_ON(msec > (TEST_SUSPEND_SECONDS * 1000)); 176 WARN(msec > (TEST_SUSPEND_SECONDS * 1000), "Component: %s\n", label);
177} 177}
178 178
179#else 179#else
@@ -237,6 +237,10 @@ static int suspend_prepare(void)
237 if (error) 237 if (error)
238 goto Finish; 238 goto Finish;
239 239
240 error = usermodehelper_disable();
241 if (error)
242 goto Finish;
243
240 if (suspend_freeze_processes()) { 244 if (suspend_freeze_processes()) {
241 error = -EAGAIN; 245 error = -EAGAIN;
242 goto Thaw; 246 goto Thaw;
@@ -256,6 +260,7 @@ static int suspend_prepare(void)
256 260
257 Thaw: 261 Thaw:
258 suspend_thaw_processes(); 262 suspend_thaw_processes();
263 usermodehelper_enable();
259 Finish: 264 Finish:
260 pm_notifier_call_chain(PM_POST_SUSPEND); 265 pm_notifier_call_chain(PM_POST_SUSPEND);
261 pm_restore_console(); 266 pm_restore_console();
@@ -311,7 +316,7 @@ static int suspend_enter(suspend_state_t state)
311 */ 316 */
312int suspend_devices_and_enter(suspend_state_t state) 317int suspend_devices_and_enter(suspend_state_t state)
313{ 318{
314 int error, ftrace_save; 319 int error;
315 320
316 if (!suspend_ops) 321 if (!suspend_ops)
317 return -ENOSYS; 322 return -ENOSYS;
@@ -322,7 +327,6 @@ int suspend_devices_and_enter(suspend_state_t state)
322 goto Close; 327 goto Close;
323 } 328 }
324 suspend_console(); 329 suspend_console();
325 ftrace_save = __ftrace_enabled_save();
326 suspend_test_start(); 330 suspend_test_start();
327 error = device_suspend(PMSG_SUSPEND); 331 error = device_suspend(PMSG_SUSPEND);
328 if (error) { 332 if (error) {
@@ -354,7 +358,6 @@ int suspend_devices_and_enter(suspend_state_t state)
354 suspend_test_start(); 358 suspend_test_start();
355 device_resume(PMSG_RESUME); 359 device_resume(PMSG_RESUME);
356 suspend_test_finish("resume devices"); 360 suspend_test_finish("resume devices");
357 __ftrace_enabled_restore(ftrace_save);
358 resume_console(); 361 resume_console();
359 Close: 362 Close:
360 if (suspend_ops->end) 363 if (suspend_ops->end)
@@ -376,6 +379,7 @@ int suspend_devices_and_enter(suspend_state_t state)
376static void suspend_finish(void) 379static void suspend_finish(void)
377{ 380{
378 suspend_thaw_processes(); 381 suspend_thaw_processes();
382 usermodehelper_enable();
379 pm_notifier_call_chain(PM_POST_SUSPEND); 383 pm_notifier_call_chain(PM_POST_SUSPEND);
380 pm_restore_console(); 384 pm_restore_console();
381} 385}