Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38984 )
Change subject: mb/google/{auron,slippy}/ec: clear pending events on S3 wakeup ......................................................................
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 --- M src/mainboard/google/auron/ec.c M src/mainboard/google/slippy/ec.c 2 files changed, 16 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Furquan Shaikh: Looks good to me, approved
diff --git a/src/mainboard/google/auron/ec.c b/src/mainboard/google/auron/ec.c index 3fc5373..0589864 100644 --- a/src/mainboard/google/auron/ec.c +++ b/src/mainboard/google/auron/ec.c @@ -29,10 +29,17 @@ .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 f8ab6b8..e296575 100644 --- a/src/mainboard/google/slippy/ec.c +++ b/src/mainboard/google/slippy/ec.c @@ -28,10 +28,17 @@ .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); }