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