aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/suspend.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/suspend.c')
-rw-r--r--kernel/power/suspend.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 2814c32aed51..6275970b2189 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -164,8 +164,11 @@ static int suspend_enter(suspend_state_t state)
164 BUG_ON(!irqs_disabled()); 164 BUG_ON(!irqs_disabled());
165 165
166 error = sysdev_suspend(PMSG_SUSPEND); 166 error = sysdev_suspend(PMSG_SUSPEND);
167 if (!error) 167 if (!error) {
168 error = syscore_suspend(); 168 error = syscore_suspend();
169 if (error)
170 sysdev_resume();
171 }
169 if (!error) { 172 if (!error) {
170 if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { 173 if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) {
171 error = suspend_ops->enter(state); 174 error = suspend_ops->enter(state);
@@ -213,7 +216,6 @@ int suspend_devices_and_enter(suspend_state_t state)
213 goto Close; 216 goto Close;
214 } 217 }
215 suspend_console(); 218 suspend_console();
216 pm_restrict_gfp_mask();
217 suspend_test_start(); 219 suspend_test_start();
218 error = dpm_suspend_start(PMSG_SUSPEND); 220 error = dpm_suspend_start(PMSG_SUSPEND);
219 if (error) { 221 if (error) {
@@ -230,7 +232,6 @@ int suspend_devices_and_enter(suspend_state_t state)
230 suspend_test_start(); 232 suspend_test_start();
231 dpm_resume_end(PMSG_RESUME); 233 dpm_resume_end(PMSG_RESUME);
232 suspend_test_finish("resume devices"); 234 suspend_test_finish("resume devices");
233 pm_restore_gfp_mask();
234 resume_console(); 235 resume_console();
235 Close: 236 Close:
236 if (suspend_ops->end) 237 if (suspend_ops->end)
@@ -291,7 +292,9 @@ int enter_state(suspend_state_t state)
291 goto Finish; 292 goto Finish;
292 293
293 pr_debug("PM: Entering %s sleep\n", pm_states[state]); 294 pr_debug("PM: Entering %s sleep\n", pm_states[state]);
295 pm_restrict_gfp_mask();
294 error = suspend_devices_and_enter(state); 296 error = suspend_devices_and_enter(state);
297 pm_restore_gfp_mask();
295 298
296 Finish: 299 Finish:
297 pr_debug("PM: Finishing wakeup.\n"); 300 pr_debug("PM: Finishing wakeup.\n");