summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2020-02-18 16:06:04 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-02-24 12:45:48 +0000
commit0868f964398e401c7c100627e6c2d713699772a0 (patch)
treee848a3f7a17d23d3e98c97ad53f6b8666735451a
parent96eceba31424a97c183a8111a039fba342565dba (diff)
mb/google/{auron,slippy}/ec: clear pending events on S3 wakeup
Commit 6ae8b50 [chromeec: Depend on events_copy_b to identify wake source] partially broke resume from suspend on Auron and Slippy variants when multiple events exist in the EC event queue. In the case of the device suspending manually and then subsequently having the lid closed, the device will be stuck in a resume/suspend/resume loop until the device is forcibly powered down. Mitigate this by clearing any pending EC events on S3 wakeup. Test: build/boot several Auron/Slippy variants, test suspend/resume functional with both single and multiple events in EC event queue. Change-Id: I7ec9ec575d41c5b7522c4e13fc32b0b7c77d20d9 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38984 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
-rw-r--r--src/mainboard/google/auron/ec.c9
-rw-r--r--src/mainboard/google/slippy/ec.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/src/mainboard/google/auron/ec.c b/src/mainboard/google/auron/ec.c
index 3fc5373096..0589864d7f 100644
--- a/src/mainboard/google/auron/ec.c
+++ b/src/mainboard/google/auron/ec.c
@@ -29,10 +29,17 @@ void mainboard_ec_init(void)
.s5_wake_events = MAINBOARD_EC_S5_WAKE_EVENTS,
};
+ int s3_wakeup = acpi_is_wakeup_s3();
+
printk(BIOS_DEBUG, "mainboard_ec_init\n");
post_code(0xf0);
- google_chromeec_events_init(&info, acpi_is_wakeup_s3());
+ google_chromeec_events_init(&info, s3_wakeup);
+ if (s3_wakeup) {
+ /* Clear pending events. */
+ while (google_chromeec_get_event() != 0)
+ ;
+ }
post_code(0xf1);
}
diff --git a/src/mainboard/google/slippy/ec.c b/src/mainboard/google/slippy/ec.c
index f8ab6b81d5..e296575a92 100644
--- a/src/mainboard/google/slippy/ec.c
+++ b/src/mainboard/google/slippy/ec.c
@@ -28,10 +28,17 @@ void mainboard_ec_init(void)
.s5_wake_events = MAINBOARD_EC_S5_WAKE_EVENTS,
};
+ int s3_wakeup = acpi_is_wakeup_s3();
+
printk(BIOS_DEBUG, "mainboard_ec_init\n");
post_code(0xf0);
- google_chromeec_events_init(&info, acpi_is_wakeup_s3());
+ google_chromeec_events_init(&info, s3_wakeup);
+ if (s3_wakeup) {
+ /* Clear pending events. */
+ while (google_chromeec_get_event() != 0)
+ ;
+ }
post_code(0xf1);
}