summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2014-06-19 13:32:15 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-23 21:48:42 +0000
commit68abc0f4288b6b9521f1dd05811f4b1f15e78287 (patch)
treed9152ce941dd0ba33fd67bd9e8d90d829679f684
parent09db229f212a95bc674625895e68670a7aa57c00 (diff)
downloadchrome-ec-68abc0f4288b6b9521f1dd05811f4b1f15e78287.tar.gz
watchdog: Give more leeway to the independent watchdog
It would be really nice to be guaranteed to see watchdog warnings before we actually hit a watchdog reset even if something strange is going on with the CPU. Let's increase the margin between the timer and the independent so that the hardware watchdog is really hit as a last resort. It seems like a 1.6 second hardware watchdog wouldn't be the end of the world so let's bump that way rather than increasing the number of warnings. BRANCH=ToT BUG=chrome-os-partner:29162 TEST="waitms 1000" on EC console no longer ever reboots and "waitms 2000" usually does. Change-Id: Ic5e5ddec22fb8484cc7c552b19d3f2043c105d0c Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/204895 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--board/zinger/board.h2
-rw-r--r--chip/host/config_chip.h4
-rw-r--r--chip/it83xx/config_chip.h3
-rw-r--r--chip/lm4/config_chip.h3
-rw-r--r--chip/mec1322/config_chip.h3
-rw-r--r--chip/stm32/config_chip.h3
-rw-r--r--include/config.h17
7 files changed, 24 insertions, 11 deletions
diff --git a/board/zinger/board.h b/board/zinger/board.h
index d8184669c0..c0cc19f2d2 100644
--- a/board/zinger/board.h
+++ b/board/zinger/board.h
@@ -23,7 +23,7 @@
#define CONFIG_SHA1
#undef CONFIG_WATCHDOG_HELP
#undef CONFIG_WATCHDOG_PERIOD_MS
-#define CONFIG_WATCHDOG_PERIOD_MS 1800
+#define CONFIG_WATCHDOG_PERIOD_MS 2300
#undef CONFIG_LID_SWITCH
#undef CONFIG_TASK_PROFILING
#undef CONFIG_COMMON_GPIO
diff --git a/chip/host/config_chip.h b/chip/host/config_chip.h
index 906aa232b2..db61262ce2 100644
--- a/chip/host/config_chip.h
+++ b/chip/host/config_chip.h
@@ -42,7 +42,8 @@ extern char __host_flash[CONFIG_FLASH_PHYSICAL_SIZE];
#define DEFERRABLE_MAX_COUNT 8
/* Interval between HOOK_TICK notifications */
-#define HOOK_TICK_INTERVAL (250 * MSEC)
+#define HOOK_TICK_INTERVAL_MS 250
+#define HOOK_TICK_INTERVAL (HOOK_TICK_INTERVAL_MS * MSEC)
/* Do NOT use common panic code (designed to output information on the UART) */
#undef CONFIG_COMMON_PANIC_OUTPUT
@@ -50,4 +51,3 @@ extern char __host_flash[CONFIG_FLASH_PHYSICAL_SIZE];
#undef CONFIG_COMMON_TIMER
#endif /* __CROS_EC_CONFIG_CHIP_H */
-
diff --git a/chip/it83xx/config_chip.h b/chip/it83xx/config_chip.h
index 6a564cd412..1ba70fa3aa 100644
--- a/chip/it83xx/config_chip.h
+++ b/chip/it83xx/config_chip.h
@@ -13,7 +13,8 @@
#define CONFIG_IRQ_COUNT 16
/* Interval between HOOK_TICK notifications */
-#define HOOK_TICK_INTERVAL (500 * MSEC)
+#define HOOK_TICK_INTERVAL_MS 500
+#define HOOK_TICK_INTERVAL (HOOK_TICK_INTERVAL_MS * MSEC)
/* Maximum number of deferrable functions */
#define DEFERRABLE_MAX_COUNT 8
diff --git a/chip/lm4/config_chip.h b/chip/lm4/config_chip.h
index 19b331966e..88f6a76668 100644
--- a/chip/lm4/config_chip.h
+++ b/chip/lm4/config_chip.h
@@ -20,7 +20,8 @@
#define CONFIG_UART_TX_BUF_SIZE 8192
/* Interval between HOOK_TICK notifications */
-#define HOOK_TICK_INTERVAL (250 * MSEC)
+#define HOOK_TICK_INTERVAL_MS 250
+#define HOOK_TICK_INTERVAL (HOOK_TICK_INTERVAL_MS * MSEC)
/* Maximum number of deferrable functions */
#define DEFERRABLE_MAX_COUNT 8
diff --git a/chip/mec1322/config_chip.h b/chip/mec1322/config_chip.h
index e47f102759..939107ca8c 100644
--- a/chip/mec1322/config_chip.h
+++ b/chip/mec1322/config_chip.h
@@ -17,7 +17,8 @@
#define CONFIG_UART_TX_BUF_SIZE 2048
/* Interval between HOOK_TICK notifications */
-#define HOOK_TICK_INTERVAL (250 * MSEC)
+#define HOOK_TICK_INTERVAL_MS 250
+#define HOOK_TICK_INTERVAL (HOOK_TICK_INTERVAL_MS * MSEC)
/* Maximum number of deferrable functions */
#define DEFERRABLE_MAX_COUNT 8
diff --git a/chip/stm32/config_chip.h b/chip/stm32/config_chip.h
index d3143d8c86..1d2020a36e 100644
--- a/chip/stm32/config_chip.h
+++ b/chip/stm32/config_chip.h
@@ -54,7 +54,8 @@
#define LARGER_TASK_STACK_SIZE 640
/* Interval between HOOK_TICK notifications */
-#define HOOK_TICK_INTERVAL (500 * MSEC)
+#define HOOK_TICK_INTERVAL_MS 500
+#define HOOK_TICK_INTERVAL (HOOK_TICK_INTERVAL_MS * MSEC)
/* Maximum number of deferrable functions */
#define DEFERRABLE_MAX_COUNT 8
diff --git a/include/config.h b/include/config.h
index ef4bef2406..a990e4028a 100644
--- a/include/config.h
+++ b/include/config.h
@@ -934,14 +934,14 @@
*/
#undef CONFIG_WATCHDOG_HELP
-/* Watchdog period in ms; must be at least twice HOOK_TICK_INTERVAL */
-#define CONFIG_WATCHDOG_PERIOD_MS 1100
+/* Watchdog period in ms; see also AUX_TIMER_PERIOD_MS */
+#define CONFIG_WATCHDOG_PERIOD_MS 1600
/*
- * Fire auxiliary timer 50ms before watchdog timer expires. This leaves
+ * Fire auxiliary timer 500ms before watchdog timer expires. This leaves
* some time for debug trace to be printed.
*/
-#define CONFIG_AUX_TIMER_PERIOD_MS (CONFIG_WATCHDOG_PERIOD_MS - 50)
+#define CONFIG_AUX_TIMER_PERIOD_MS (CONFIG_WATCHDOG_PERIOD_MS - 500)
/*****************************************************************************/
@@ -1025,4 +1025,13 @@
#include "test_config.h"
+/*****************************************************************************/
+/*
+ * Sanity checks to make sure some of the configs above make sense.
+ */
+
+#if (CONFIG_AUX_TIMER_PERIOD_MS) < ((HOOK_TICK_INTERVAL_MS) * 2)
+#error "CONFIG_AUX_TIMER_PERIOD_MS must be at least 2x HOOK_TICK_INTERVAL_MS"
+#endif
+
#endif /* __CROS_EC_CONFIG_H */