[PATCH] acpi/s3: fix no suspend & resume time for s2idle

Alex Hung alex.hung at canonical.com
Wed Oct 30 17:55:17 UTC 2019


This is to fix

Suspend/Resume Timings:
  Could not determine time to suspend.
  Could not determine time to resume.

to

Suspend/Resume Timings:
  Suspend: 0.282 seconds.
  Resume:  1.008 seconds.

Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/acpi/s3/s3.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
index 5ec8d5c8..f0582152 100644
--- a/src/acpi/s3/s3.c
+++ b/src/acpi/s3/s3.c
@@ -445,6 +445,19 @@ static int s3_scan_times(
 				s3_suspend_finish = previous_ts;
 			continue;
 		}
+
+		/* get log time for s2idle */
+		if (strstr(txt, "PM: suspend-to-idle")) {
+			s3_suspend_finish = ts;
+			continue;
+		}
+		if (strstr(txt, "PM: Timekeeping suspended")) {
+			s3_resume_start = ts;
+			if (s3_suspend_finish < 0.0)
+				s3_suspend_finish = previous_ts;
+			continue;
+		}
+
 		if (strstr(txt, "Restarting tasks ... done")) {
 			s3_resume_finish = ts;
 			break;
-- 
2.17.1




More information about the fwts-devel mailing list