Hibernation: Invoke suspend notifications after console switch

Following the recent change in the suspend code path, switch consoles before
calling PM notifiers during hibernation.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by Rafael J. Wysocki and committed by Len Brown 5a0a2f30 af258f51

+7 -10
+7 -10
kernel/power/disk.c
··· 458 while(1); 459 } 460 461 - static void unprepare_processes(void) 462 - { 463 - thaw_processes(); 464 - pm_restore_console(); 465 - } 466 - 467 static int prepare_processes(void) 468 { 469 int error = 0; 470 471 - pm_prepare_console(); 472 if (freeze_processes()) { 473 error = -EBUSY; 474 - unprepare_processes(); 475 } 476 return error; 477 } ··· 484 goto Unlock; 485 } 486 487 error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); 488 if (error) 489 goto Exit; ··· 524 swsusp_free(); 525 } 526 Thaw: 527 - unprepare_processes(); 528 Finish: 529 free_basic_memory_bitmaps(); 530 Exit: 531 pm_notifier_call_chain(PM_POST_HIBERNATION); 532 atomic_inc(&snapshot_device_available); 533 Unlock: 534 mutex_unlock(&pm_mutex); ··· 598 goto Unlock; 599 } 600 601 error = pm_notifier_call_chain(PM_RESTORE_PREPARE); 602 if (error) 603 goto Finish; ··· 622 623 printk(KERN_ERR "PM: Restore failed, recovering.\n"); 624 swsusp_free(); 625 - unprepare_processes(); 626 Done: 627 free_basic_memory_bitmaps(); 628 Finish: 629 pm_notifier_call_chain(PM_POST_RESTORE); 630 atomic_inc(&snapshot_device_available); 631 /* For success case, the suspend path will release the lock */ 632 Unlock:
··· 458 while(1); 459 } 460 461 static int prepare_processes(void) 462 { 463 int error = 0; 464 465 if (freeze_processes()) { 466 error = -EBUSY; 467 + thaw_processes(); 468 } 469 return error; 470 } ··· 491 goto Unlock; 492 } 493 494 + pm_prepare_console(); 495 error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); 496 if (error) 497 goto Exit; ··· 530 swsusp_free(); 531 } 532 Thaw: 533 + thaw_processes(); 534 Finish: 535 free_basic_memory_bitmaps(); 536 Exit: 537 pm_notifier_call_chain(PM_POST_HIBERNATION); 538 + pm_restore_console(); 539 atomic_inc(&snapshot_device_available); 540 Unlock: 541 mutex_unlock(&pm_mutex); ··· 603 goto Unlock; 604 } 605 606 + pm_prepare_console(); 607 error = pm_notifier_call_chain(PM_RESTORE_PREPARE); 608 if (error) 609 goto Finish; ··· 626 627 printk(KERN_ERR "PM: Restore failed, recovering.\n"); 628 swsusp_free(); 629 + thaw_processes(); 630 Done: 631 free_basic_memory_bitmaps(); 632 Finish: 633 pm_notifier_call_chain(PM_POST_RESTORE); 634 + pm_restore_console(); 635 atomic_inc(&snapshot_device_available); 636 /* For success case, the suspend path will release the lock */ 637 Unlock: