aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-19 21:38:07 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-21 20:33:03 -0400
commit8915aa2042f85ecf86d4a202ef6d04bf06f05cca (patch)
tree85458428f75e7cdbcf0271614a0aec29ed3fd850
parent8d8b2441db9647890251538f60b75a4e45fdef8d (diff)
PM / sleep: Mark suspend/hibernation start and finish
Regardless of whether or not debug messages from the core system suspend/hibernation code are enabled, it is useful to know when system-wide transitions start and finish (or fail), so print "info" messages at these points. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Mark Salyzyn <salyzyn@android.com>
-rw-r--r--kernel/power/hibernate.c5
-rw-r--r--kernel/power/suspend.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index e19ee179d211..a5c36e9c56a6 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -692,6 +692,7 @@ int hibernate(void)
692 goto Unlock; 692 goto Unlock;
693 } 693 }
694 694
695 pr_info("hibernation entry\n");
695 pm_prepare_console(); 696 pm_prepare_console();
696 error = __pm_notifier_call_chain(PM_HIBERNATION_PREPARE, -1, &nr_calls); 697 error = __pm_notifier_call_chain(PM_HIBERNATION_PREPARE, -1, &nr_calls);
697 if (error) { 698 if (error) {
@@ -762,6 +763,8 @@ int hibernate(void)
762 atomic_inc(&snapshot_device_available); 763 atomic_inc(&snapshot_device_available);
763 Unlock: 764 Unlock:
764 unlock_system_sleep(); 765 unlock_system_sleep();
766 pr_info("hibernation exit\n");
767
765 return error; 768 return error;
766} 769}
767 770
@@ -868,6 +871,7 @@ static int software_resume(void)
868 goto Unlock; 871 goto Unlock;
869 } 872 }
870 873
874 pr_info("resume from hibernation\n");
871 pm_prepare_console(); 875 pm_prepare_console();
872 error = __pm_notifier_call_chain(PM_RESTORE_PREPARE, -1, &nr_calls); 876 error = __pm_notifier_call_chain(PM_RESTORE_PREPARE, -1, &nr_calls);
873 if (error) { 877 if (error) {
@@ -884,6 +888,7 @@ static int software_resume(void)
884 Finish: 888 Finish:
885 __pm_notifier_call_chain(PM_POST_RESTORE, nr_calls, NULL); 889 __pm_notifier_call_chain(PM_POST_RESTORE, nr_calls, NULL);
886 pm_restore_console(); 890 pm_restore_console();
891 pr_info("resume from hibernation failed (%d)\n", error);
887 atomic_inc(&snapshot_device_available); 892 atomic_inc(&snapshot_device_available);
888 /* For success case, the suspend path will release the lock */ 893 /* For success case, the suspend path will release the lock */
889 Unlock: 894 Unlock:
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 4f10773322fa..18cdb1596d27 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -584,6 +584,7 @@ int pm_suspend(suspend_state_t state)
584 if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) 584 if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
585 return -EINVAL; 585 return -EINVAL;
586 586
587 pr_info("PM: suspend entry (%s)\n", pm_states[state]);
587 error = enter_state(state); 588 error = enter_state(state);
588 if (error) { 589 if (error) {
589 suspend_stats.fail++; 590 suspend_stats.fail++;
@@ -591,6 +592,7 @@ int pm_suspend(suspend_state_t state)
591 } else { 592 } else {
592 suspend_stats.success++; 593 suspend_stats.success++;
593 } 594 }
595 pr_info("PM: suspend exit\n");
594 return error; 596 return error;
595} 597}
596EXPORT_SYMBOL(pm_suspend); 598EXPORT_SYMBOL(pm_suspend);