Commit 3540d38d authored by Bart Van Assche's avatar Bart Van Assche Committed by Rafael J. Wysocki

PM: sleep: Show how long dpm_suspend_start() and dpm_suspend_end() take

When debugging device driver power management code it is convenient to
know how much time is spent in the "suspend start" and "suspend end"
phases. Hence log the time spent in these phases.
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 1ec0cd82
...@@ -1631,17 +1631,20 @@ int dpm_suspend_late(pm_message_t state) ...@@ -1631,17 +1631,20 @@ int dpm_suspend_late(pm_message_t state)
*/ */
int dpm_suspend_end(pm_message_t state) int dpm_suspend_end(pm_message_t state)
{ {
int error = dpm_suspend_late(state); ktime_t starttime = ktime_get();
int error;
error = dpm_suspend_late(state);
if (error) if (error)
return error; goto out;
error = dpm_suspend_noirq(state); error = dpm_suspend_noirq(state);
if (error) { if (error)
dpm_resume_early(resume_event(state)); dpm_resume_early(resume_event(state));
return error;
}
return 0; out:
dpm_show_time(starttime, state, error, "end");
return error;
} }
EXPORT_SYMBOL_GPL(dpm_suspend_end); EXPORT_SYMBOL_GPL(dpm_suspend_end);
...@@ -2034,6 +2037,7 @@ int dpm_prepare(pm_message_t state) ...@@ -2034,6 +2037,7 @@ int dpm_prepare(pm_message_t state)
*/ */
int dpm_suspend_start(pm_message_t state) int dpm_suspend_start(pm_message_t state)
{ {
ktime_t starttime = ktime_get();
int error; int error;
error = dpm_prepare(state); error = dpm_prepare(state);
...@@ -2042,6 +2046,7 @@ int dpm_suspend_start(pm_message_t state) ...@@ -2042,6 +2046,7 @@ int dpm_suspend_start(pm_message_t state)
dpm_save_failed_step(SUSPEND_PREPARE); dpm_save_failed_step(SUSPEND_PREPARE);
} else } else
error = dpm_suspend(state); error = dpm_suspend(state);
dpm_show_time(starttime, state, error, "start");
return error; return error;
} }
EXPORT_SYMBOL_GPL(dpm_suspend_start); EXPORT_SYMBOL_GPL(dpm_suspend_start);
......
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