aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/hibernate.c')
-rw-r--r--kernel/power/hibernate.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 3124cebaec31..797f19e2aaa9 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -647,7 +647,7 @@ static void power_down(void)
647 */ 647 */
648int hibernate(void) 648int hibernate(void)
649{ 649{
650 int error; 650 int error, nr_calls = 0;
651 651
652 if (!hibernation_available()) { 652 if (!hibernation_available()) {
653 pr_debug("PM: Hibernation not available.\n"); 653 pr_debug("PM: Hibernation not available.\n");
@@ -662,9 +662,11 @@ int hibernate(void)
662 } 662 }
663 663
664 pm_prepare_console(); 664 pm_prepare_console();
665 error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); 665 error = __pm_notifier_call_chain(PM_HIBERNATION_PREPARE, -1, &nr_calls);
666 if (error) 666 if (error) {
667 nr_calls--;
667 goto Exit; 668 goto Exit;
669 }
668 670
669 printk(KERN_INFO "PM: Syncing filesystems ... "); 671 printk(KERN_INFO "PM: Syncing filesystems ... ");
670 sys_sync(); 672 sys_sync();
@@ -714,7 +716,7 @@ int hibernate(void)
714 /* Don't bother checking whether freezer_test_done is true */ 716 /* Don't bother checking whether freezer_test_done is true */
715 freezer_test_done = false; 717 freezer_test_done = false;
716 Exit: 718 Exit:
717 pm_notifier_call_chain(PM_POST_HIBERNATION); 719 __pm_notifier_call_chain(PM_POST_HIBERNATION, nr_calls, NULL);
718 pm_restore_console(); 720 pm_restore_console();
719 atomic_inc(&snapshot_device_available); 721 atomic_inc(&snapshot_device_available);
720 Unlock: 722 Unlock:
@@ -740,7 +742,7 @@ int hibernate(void)
740 */ 742 */
741static int software_resume(void) 743static int software_resume(void)
742{ 744{
743 int error; 745 int error, nr_calls = 0;
744 unsigned int flags; 746 unsigned int flags;
745 747
746 /* 748 /*
@@ -827,9 +829,11 @@ static int software_resume(void)
827 } 829 }
828 830
829 pm_prepare_console(); 831 pm_prepare_console();
830 error = pm_notifier_call_chain(PM_RESTORE_PREPARE); 832 error = __pm_notifier_call_chain(PM_RESTORE_PREPARE, -1, &nr_calls);
831 if (error) 833 if (error) {
834 nr_calls--;
832 goto Close_Finish; 835 goto Close_Finish;
836 }
833 837
834 pr_debug("PM: Preparing processes for restore.\n"); 838 pr_debug("PM: Preparing processes for restore.\n");
835 error = freeze_processes(); 839 error = freeze_processes();
@@ -855,7 +859,7 @@ static int software_resume(void)
855 unlock_device_hotplug(); 859 unlock_device_hotplug();
856 thaw_processes(); 860 thaw_processes();
857 Finish: 861 Finish:
858 pm_notifier_call_chain(PM_POST_RESTORE); 862 __pm_notifier_call_chain(PM_POST_RESTORE, nr_calls, NULL);
859 pm_restore_console(); 863 pm_restore_console();
860 atomic_inc(&snapshot_device_available); 864 atomic_inc(&snapshot_device_available);
861 /* For success case, the suspend path will release the lock */ 865 /* For success case, the suspend path will release the lock */