aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/power/hibernate.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index f9bec56d8825..6418d8c8cdb2 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -248,12 +248,6 @@ static int create_image(int platform_mode)
248 if (error) 248 if (error)
249 return error; 249 return error;
250 250
251 /* At this point, dpm_suspend_start() has been called, but *not*
252 * dpm_suspend_noirq(). We *must* call dpm_suspend_noirq() now.
253 * Otherwise, drivers for some devices (e.g. interrupt controllers)
254 * become desynchronized with the actual state of the hardware
255 * at resume time, and evil weirdness ensues.
256 */
257 error = dpm_suspend_noirq(PMSG_FREEZE); 251 error = dpm_suspend_noirq(PMSG_FREEZE);
258 if (error) { 252 if (error) {
259 printk(KERN_ERR "PM: Some devices failed to power down, " 253 printk(KERN_ERR "PM: Some devices failed to power down, "
@@ -297,9 +291,6 @@ static int create_image(int platform_mode)
297 291
298 Power_up: 292 Power_up:
299 syscore_resume(); 293 syscore_resume();
300 /* NOTE: dpm_resume_noirq() is just a resume() for devices
301 * that suspended with irqs off ... no overall powerup.
302 */
303 294
304 Enable_irqs: 295 Enable_irqs:
305 local_irq_enable(); 296 local_irq_enable();
@@ -416,24 +407,26 @@ static int resume_target_kernel(bool platform_mode)
416 if (error) 407 if (error)
417 goto Enable_irqs; 408 goto Enable_irqs;
418 409
419 /* We'll ignore saved state, but this gets preempt count (etc) right */
420 save_processor_state(); 410 save_processor_state();
421 error = restore_highmem(); 411 error = restore_highmem();
422 if (!error) { 412 if (!error) {
423 error = swsusp_arch_resume(); 413 error = swsusp_arch_resume();
424 /* 414 /*
425 * The code below is only ever reached in case of a failure. 415 * The code below is only ever reached in case of a failure.
426 * Otherwise execution continues at place where 416 * Otherwise, execution continues at the place where
427 * swsusp_arch_suspend() was called 417 * swsusp_arch_suspend() was called.
428 */ 418 */
429 BUG_ON(!error); 419 BUG_ON(!error);
430 /* This call to restore_highmem() undos the previous one */ 420 /*
421 * This call to restore_highmem() reverts the changes made by
422 * the previous one.
423 */
431 restore_highmem(); 424 restore_highmem();
432 } 425 }
433 /* 426 /*
434 * The only reason why swsusp_arch_resume() can fail is memory being 427 * The only reason why swsusp_arch_resume() can fail is memory being
435 * very tight, so we have to free it as soon as we can to avoid 428 * very tight, so we have to free it as soon as we can to avoid
436 * subsequent failures 429 * subsequent failures.
437 */ 430 */
438 swsusp_free(); 431 swsusp_free();
439 restore_processor_state(); 432 restore_processor_state();