Ravi Chandra Sadineni has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34801 )
Change subject: chromeec: Depend on events_copy_b to identify the wake source. ......................................................................
chromeec: Depend on events_copy_b to identify the wake source.
Using google_chromeec_get_event() clears the event too. Thus if the kernel has to identify the wake source, it has no way to do that. Thus instead depend on events_copy_b to log the wake source. Please look at go/hostevent-refactor for more info.
BUG=b:133262012 BRANCH=None TEST=Hack hatch bios and make sure hostevent log is correct.
Change-Id: I39caae2689e0c2a7bec16416978877885a9afc6c Signed-off-by: Ravi Chandra Sadineni ravisadineni@chromium.org --- M src/ec/google/chromeec/ec.c 1 file changed, 8 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/34801/1
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 5a2630e..9ba9b1b 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -428,7 +428,8 @@
void google_chromeec_log_events(uint64_t mask) { - u8 event; + u64 events; + int i; uint64_t wake_mask; bool restore_wake_mask = false;
@@ -445,11 +446,14 @@ restore_wake_mask = true; }
- while ((event = google_chromeec_get_event()) != 0) { - if (EC_HOST_EVENT_MASK(event) & mask) - elog_add_event_byte(ELOG_TYPE_EC_EVENT, event); + events = google_chromeec_get_events_b() & mask; + for (i = 0; i < sizeof(events) * 8; i++) { + if (EC_HOST_EVENT_MASK(i) & events) + elog_add_event_byte(ELOG_TYPE_EC_EVENT, i); }
+ google_chromeec_clear_events_b(events); + if (restore_wake_mask) google_chromeec_set_wake_mask(wake_mask); } @@ -467,10 +471,6 @@ /* Disable SMI and wake events. */ google_chromeec_set_smi_mask(0);
- /* Clear pending events. */ - while (google_chromeec_get_event() != 0) - ; - /* Restore SCI event mask. */ google_chromeec_set_sci_mask(info->sci_events);