Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1690860
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/3] PM / sleep: Mark suspend/hibernation start and finish |
| Date | 2017-07-19 03:00 +0200 |
| Message-ID | <u4Lvk-15W-15@gated-at.bofh.it> (permalink) |
| References | <u4Lvk-15W-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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>
---
kernel/power/hibernate.c | 8 ++++++++
kernel/power/suspend.c | 4 ++++
2 files changed, 12 insertions(+)
Index: linux-pm/kernel/power/hibernate.c
===================================================================
--- linux-pm.orig/kernel/power/hibernate.c
+++ linux-pm/kernel/power/hibernate.c
@@ -692,6 +692,7 @@ int hibernate(void)
goto Unlock;
}
+ pr_info("Starting hibernation\n");
pm_prepare_console();
error = __pm_notifier_call_chain(PM_HIBERNATION_PREPARE, -1, &nr_calls);
if (error) {
@@ -762,6 +763,11 @@ int hibernate(void)
atomic_inc(&snapshot_device_available);
Unlock:
unlock_system_sleep();
+ if (error)
+ pr_info("Hibernation failed (%d)\n", error);
+ else
+ pr_info("System resume complete\n");
+
return error;
}
@@ -868,6 +874,7 @@ static int software_resume(void)
goto Unlock;
}
+ pr_info("Starting resume from hibernation\n");
pm_prepare_console();
error = __pm_notifier_call_chain(PM_RESTORE_PREPARE, -1, &nr_calls);
if (error) {
@@ -884,6 +891,7 @@ static int software_resume(void)
Finish:
__pm_notifier_call_chain(PM_POST_RESTORE, nr_calls, NULL);
pm_restore_console();
+ pr_info("Resume from hibernation failed (%d)\n", error);
atomic_inc(&snapshot_device_available);
/* For success case, the suspend path will release the lock */
Unlock:
Index: linux-pm/kernel/power/suspend.c
===================================================================
--- linux-pm.orig/kernel/power/suspend.c
+++ linux-pm/kernel/power/suspend.c
@@ -579,12 +579,16 @@ int pm_suspend(suspend_state_t state)
if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
return -EINVAL;
+ pr_info("PM: Starting system suspend (%s)\n", pm_states[state]);
error = enter_state(state);
if (error) {
suspend_stats.fail++;
dpm_save_failed_errno(error);
+ pr_info("PM: System suspend (%s) failed (%d)\n",
+ pm_states[state], error);
} else {
suspend_stats.success++;
+ pr_info("PM: System resume complete\n");
}
return error;
}
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] PM / sleep: Avoid filling up kernel log buffer with debug messages "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-19 03:00 +0200
[PATCH 3/3] PM / timekeeping: Print debug messages when requested "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-19 03:00 +0200
Re: [PATCH 3/3] PM / timekeeping: Print debug messages when requested "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-21 00:10 +0200
[PATCH 2/3] PM / sleep: Mark suspend/hibernation start and finish "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-19 03:00 +0200
[PATCH v2 2/3] PM / sleep: Mark suspend/hibernation start and finish "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-20 03:50 +0200
Re: [PATCH v2 2/3] PM / sleep: Mark suspend/hibernation start and finish Mark Salyzyn <salyzyn@android.com> - 2017-07-20 20:00 +0200
Re: [PATCH v2 2/3] PM / sleep: Mark suspend/hibernation start and finish "Rafael J. Wysocki" <rafael@kernel.org> - 2017-07-20 23:10 +0200
csiph-web