Commit 8915aa20 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarMark Salyzyn <salyzyn@android.com>
parent 8d8b2441
...@@ -692,6 +692,7 @@ int hibernate(void) ...@@ -692,6 +692,7 @@ int hibernate(void)
goto Unlock; goto Unlock;
} }
pr_info("hibernation entry\n");
pm_prepare_console(); pm_prepare_console();
error = __pm_notifier_call_chain(PM_HIBERNATION_PREPARE, -1, &nr_calls); error = __pm_notifier_call_chain(PM_HIBERNATION_PREPARE, -1, &nr_calls);
if (error) { if (error) {
...@@ -762,6 +763,8 @@ int hibernate(void) ...@@ -762,6 +763,8 @@ int hibernate(void)
atomic_inc(&snapshot_device_available); atomic_inc(&snapshot_device_available);
Unlock: Unlock:
unlock_system_sleep(); unlock_system_sleep();
pr_info("hibernation exit\n");
return error; return error;
} }
...@@ -868,6 +871,7 @@ static int software_resume(void) ...@@ -868,6 +871,7 @@ static int software_resume(void)
goto Unlock; goto Unlock;
} }
pr_info("resume from hibernation\n");
pm_prepare_console(); pm_prepare_console();
error = __pm_notifier_call_chain(PM_RESTORE_PREPARE, -1, &nr_calls); error = __pm_notifier_call_chain(PM_RESTORE_PREPARE, -1, &nr_calls);
if (error) { if (error) {
...@@ -884,6 +888,7 @@ static int software_resume(void) ...@@ -884,6 +888,7 @@ static int software_resume(void)
Finish: Finish:
__pm_notifier_call_chain(PM_POST_RESTORE, nr_calls, NULL); __pm_notifier_call_chain(PM_POST_RESTORE, nr_calls, NULL);
pm_restore_console(); pm_restore_console();
pr_info("resume from hibernation failed (%d)\n", error);
atomic_inc(&snapshot_device_available); atomic_inc(&snapshot_device_available);
/* For success case, the suspend path will release the lock */ /* For success case, the suspend path will release the lock */
Unlock: Unlock:
......
...@@ -584,6 +584,7 @@ int pm_suspend(suspend_state_t state) ...@@ -584,6 +584,7 @@ int pm_suspend(suspend_state_t state)
if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
return -EINVAL; return -EINVAL;
pr_info("PM: suspend entry (%s)\n", pm_states[state]);
error = enter_state(state); error = enter_state(state);
if (error) { if (error) {
suspend_stats.fail++; suspend_stats.fail++;
...@@ -591,6 +592,7 @@ int pm_suspend(suspend_state_t state) ...@@ -591,6 +592,7 @@ int pm_suspend(suspend_state_t state)
} else { } else {
suspend_stats.success++; suspend_stats.success++;
} }
pr_info("PM: suspend exit\n");
return error; return error;
} }
EXPORT_SYMBOL(pm_suspend); EXPORT_SYMBOL(pm_suspend);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment