diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-07-01 13:44:03 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-04 05:43:32 +0000 |
commit | 4c9d9bc5174a9fc29223cb81f21c824b0e935003 (patch) | |
tree | 0e019872e6c77fa8e6768684d6300f1341f1c543 | |
parent | 92e5894d18d64a310f1500932e76be35e5ea88a4 (diff) | |
download | chrome-ec-4c9d9bc5174a9fc29223cb81f21c824b0e935003.tar.gz |
mec1322: Don't enable interrupt before or after hibernation
When interrupts are enabledn in system_hibernate, handlers can be
called while various peripherals are disabled (at the entry of
system_hibernate).
This patch removes calls to interrupt_enable() before wfi to guarantee
once system_hibernate is called, no context switches occur until EC
resets.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/128455667
BRANCH=strago
TEST=Leave device for 60 min. Verify it wakes up by power button.
Change-Id: I2ce34538880dd6faf2f05e8152700a395b27f4aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1684231
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | chip/mec1322/system.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c index ae60d48c53..310498a168 100644 --- a/chip/mec1322/system.c +++ b/chip/mec1322/system.c @@ -278,7 +278,6 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) gpio_enable_interrupt(*pin); } - interrupt_enable(); task_enable_irq(MEC1322_IRQ_GIRQ8); task_enable_irq(MEC1322_IRQ_GIRQ9); task_enable_irq(MEC1322_IRQ_GIRQ10); @@ -289,7 +288,6 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) if (seconds || microseconds) { MEC1322_INT_BLK_EN |= 1 << 17; MEC1322_INT_ENABLE(17) |= MEC1322_INT_SOURCE_HTIMER; - interrupt_enable(); task_enable_irq(MEC1322_IRQ_HTIMER); if (seconds > 2) { ASSERT(seconds <= 0xffff / 8); |