summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-09-12 16:22:03 -0700
committerGerrit <chrome-bot@google.com>2012-09-12 21:17:15 -0700
commitb4d73d3c72d5773e39812ba069dfff12d6da71c1 (patch)
tree1f9bff564c9b55edbc74330de4d471851ac7d1f1
parent88ff608ae261ceca193e7d5689dc67b1536ce3eb (diff)
downloadchrome-ec-b4d73d3c72d5773e39812ba069dfff12d6da71c1.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 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>
-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) {