diff mbox

[3/3] acpi: s3: sleep for s3_min_delay after sending KEY_SLEEP

Message ID 1405066855-17918-3-git-send-email-kengyu@canonical.com
State Rejected
Headers show

Commit Message

Keng-Yu Lin July 11, 2014, 8:20 a.m. UTC
Unlike `pm-suspend` only returns to fwts when the suspending
is completed, acpi_fakekey returns immediately after sending
the keycode while the system is still in middle of suspending.

So let fwts sleep for seconds of s3_min_delay after sending
the keycode.

Also increase s3_min_delay to 10 seconds.

Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
---
 src/acpi/s3/s3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
index 69f526b..f0d3f89 100644
--- a/src/acpi/s3/s3.c
+++ b/src/acpi/s3/s3.c
@@ -36,7 +36,7 @@ 
 #define FWTS_RESUME		"FWTS_RESUME"
 
 static int  s3_multiple = 1;		/* number of s3 multiple tests to run */
-static int  s3_min_delay = 0;		/* min time between resume and next suspend */
+static int  s3_min_delay = 10;		/* min time between resume and next suspend */
 static int  s3_max_delay = 30;		/* max time between resume and next suspend */
 static float s3_delay_delta = 0.5;	/* amount to add to delay between each S3 tests */
 static int  s3_sleep_delay = 30;	/* time between start of suspend and wakeup */
@@ -117,6 +117,7 @@  static int s3_do_suspend_resume(fwts_framework *fw,
 
 	if (s3_sleep_key) {
 		(void)fwts_exec(acpi_fakekey_sleep, &status);
+		sleep(s3_min_delay);
 	}
 	else
 		(void)fwts_exec(command, &status);