mkbp_event: prevent unnecessary interrupts to AP

After commit 237406c5b1, there is chance
that pd_power_supply_reset() will be called during S0->S3, and it
interrupts AP and fails suspend if we are using MKBP_EVENT.
This is because mkbp_send_event() does not check power state POWER_S0S3.
Modify the condition to check events when AP is not in S0.

BRANCH=none
BUG=chrome-os-partner:50833
TEST=powerd_dbus_suspend always works without being resumed

Change-Id: Id905a2cd4d2a0376bca163f40c68bcf4208d8bf5
Signed-off-by: Koro Chen <koro.chen@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/331160
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Milton Chiang <milton.chiang@mediatek.com>
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
This commit is contained in:
Koro Chen
2016-03-07 17:48:47 +08:00
committed by chrome-bot
parent 6c116f0ffc
commit fe996b200c

View File

@@ -44,8 +44,8 @@ void mkbp_send_event(uint8_t event_type)
set_event(event_type);
#ifdef CONFIG_MKBP_WAKEUP_MASK
/* checking the event if AP suspended */
if (chipset_in_state(CHIPSET_STATE_SUSPEND)) {
/* checking the event if AP is not in S0 */
if (!chipset_in_state(CHIPSET_STATE_ON)) {
uint32_t events;
events = *(uint32_t *)host_get_memmap(EC_MEMMAP_HOST_EVENTS);
/*