summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-09-12 16:22:03 -0700
committerHung-Te Lin <hungte@chromium.org>2012-09-13 00:37:50 -0700
commit30f8374fa0a47c633ff6b149f425c865b910545c (patch)
tree3906aa780dd8053ed7ebf2c3b28f045c70051d64
parent0eb6a7d4c91c34045cc84782429135440140f083 (diff)
downloadchrome-ec-30f8374fa0a47c633ff6b149f425c865b910545c.tar.gz
fix signedness issue in deep sleep delay
From time to time, the next timer deadline might have just expired aftering entering the idle loop, so the delay might be negative, it's a bad idea to use an unsigned variable... Now, in the uncommon case where the timer is expired, the next_delay is negative, so we use the "normal" wfi path and as the timer interrupt is pending in that case, we return directly. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:13364 TEST=On Snow, plug a servo on EC serial console, shutdown the machine, unplug AC and wait for several hours. Observe we no longer have spurious watchdog reboots. BRANCH=snow Original-Change-Id: I40c7aa0fc7c1d6f9a5efaa1e7fc6615ed457196b Reviewed-on: https://gerrit.chromium.org/gerrit/33149 Reviewed-by: David Hendricks <dhendrix@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit b4d73d3c72d5773e39812ba069dfff12d6da71c1) Change-Id: I36fba48783bc8b9e4687c4194d16aea7af989ca8 Reviewed-on: https://gerrit.chromium.org/gerrit/33185 Reviewed-by: Vic Yang <victoryang@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--chip/stm32/clock-stm32f100.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32/clock-stm32f100.c b/chip/stm32/clock-stm32f100.c
index 6fc2bd29f8..7809b040cb 100644
--- a/chip/stm32/clock-stm32f100.c
+++ b/chip/stm32/clock-stm32f100.c
@@ -187,7 +187,7 @@ static void enable_serial_wakeup(int enable)
void __idle(void)
{
timestamp_t t0, t1;
- uint32_t next_delay;
+ int next_delay;
uint32_t rtc_t0, rtc_t1;
while (1) {