diff options
author | Heng-Ruey Hsu <henryhsu@google.com> | 2019-11-08 14:42:11 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-11 04:53:18 +0000 |
commit | fa1aedace7e2779224d16c7dc496f9ca7f2a8a0a (patch) | |
tree | a2a274fa9fb39b68f36fe2765be1ad94d8965a99 | |
parent | bd460722c37638e23fb37177fb4b6ac8a467e31a (diff) | |
download | chrome-ec-fa1aedace7e2779224d16c7dc496f9ca7f2a8a0a.tar.gz |
Fix skip interrupt logic for host event
If CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK and CONFIG_MKBP_EVENT_WAKEUP_MASK
are defined at the same time, |skip_interrupt| will be set for non host
events. Add a check to handle it when |events_to_add| is MKBP host
event.
BUG=b:135575671
BRANCH=none
TEST=CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK and CONFIG_MKBP_EVENT_WAKEUP_MASK
work as expected.
Change-Id: Iff72b0e276b63a211c249b3d1a92c0303012684e
Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1903630
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | common/mkbp_event.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/common/mkbp_event.c b/common/mkbp_event.c index 74fb1409fe..1b37bf78de 100644 --- a/common/mkbp_event.c +++ b/common/mkbp_event.c @@ -196,10 +196,16 @@ static void activate_mkbp_with_events(uint32_t events_to_add) int rv, schedule_deferred = 0; #ifdef CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK - /* Check to see if this host event should wake the system. */ - skip_interrupt = host_is_sleeping() && - !(host_get_events() & - mkbp_host_event_wake_mask); + /* + * Check to see if this host event should wake the system. + * Use == instead of & here since we don't want to apply the host event + * skipping logic if we are adding a host event and something else. + */ + if (events_to_add == BIT(EC_MKBP_EVENT_HOST_EVENT) || + events_to_add == BIT(EC_MKBP_EVENT_HOST_EVENT64)) + skip_interrupt = host_is_sleeping() && + !(host_get_events() & + mkbp_host_event_wake_mask); #endif /* CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK */ #ifdef CONFIG_MKBP_EVENT_WAKEUP_MASK |