summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@chromium.org>2022-08-03 10:17:25 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-04 07:25:05 +0000
commit3897c58004609708768ca1f03eeb0a349ea35c5d (patch)
tree5252d3fe7d139224f44cd616cc8e2a6351e31647
parent452460d5355a4d2bb49ca625012d924923375380 (diff)
downloadchrome-ec-3897c58004609708768ca1f03eeb0a349ea35c5d.tar.gz
Revert "mkbp: don't queue mkbp events in S3"
This reverts commit 524cba08cceb373050cf79c41e4f6f92ff519c5e. Reason for revert: b/241036338 we need EC_MKBP_EVENT_BUTTON queued in S3. Original change's description: > mkbp: don't queue mkbp events in S3 > > In S3, if a mkbp event is not a wake source, we should not queue it in > the mkbp fifo, otherwise the system will see a bunch of outdated event > after resume. > > mkbp_fifo_add() uses the return value from mkbp_send_event() to > decide if it needs to queue the event. So we need to pass the decision > through the path activate_mkbp_with_events() -> mkbp_send_event() -> > mkbp_fifo_add(). > > BUG=b:238057993 > TEST=suspend -> lidclose -> lidopen(=resume) > verify that powerd does not see the lid close event. > BRANCH=cherry > > Signed-off-by: Ting Shen <phoenixshen@google.com> > Change-Id: I3e1c58f97020d7ee2e3b4b56f14c4cadf51bef64 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3765440 > Reviewed-by: Jett Rink <jettrink@chromium.org> > Commit-Queue: Ting Shen <phoenixshen@chromium.org> > Reviewed-by: Mengqi Guo <mqg@chromium.org> > Tested-by: Ting Shen <phoenixshen@chromium.org> Bug: b:238057993 Change-Id: I0b66b06d3c834641426dda24d71fc462d0030f92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3807177 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--common/mkbp_event.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/common/mkbp_event.c b/common/mkbp_event.c
index 71ce7f8a05..b499789e04 100644
--- a/common/mkbp_event.c
+++ b/common/mkbp_event.c
@@ -201,10 +201,7 @@ static inline int host_is_sleeping(void)
static void force_mkbp_if_events(void);
DECLARE_DEFERRED(force_mkbp_if_events);
-/*
- * Send events to AP, return true if succeeded to generate host interrupt.
- */
-static bool activate_mkbp_with_events(uint32_t events_to_add)
+static void activate_mkbp_with_events(uint32_t events_to_add)
{
int interrupt_id = -1;
int skip_interrupt = 0;
@@ -246,7 +243,7 @@ static bool activate_mkbp_with_events(uint32_t events_to_add)
/* If we don't need to send an interrupt we are done */
if (interrupt_id < 0)
- return false;
+ return;
/* Send a rising edge MKBP interrupt */
rv = mkbp_set_host_active(1, &mkbp_last_event_time);
@@ -269,8 +266,6 @@ static bool activate_mkbp_with_events(uint32_t events_to_add)
if (rv != EC_SUCCESS)
CPRINTS("Could not activate MKBP (%d). Deferring", rv);
}
-
- return rv == EC_SUCCESS;
}
/*
@@ -343,7 +338,9 @@ static void force_mkbp_if_events(void)
test_mockable int mkbp_send_event(uint8_t event_type)
{
- return activate_mkbp_with_events(BIT(event_type));
+ activate_mkbp_with_events(BIT(event_type));
+
+ return 1;
}
static int set_inactive_if_no_events(void)