summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Barnaś <mb@semihalf.com>2021-05-13 13:18:58 +0200
committerCommit Bot <commit-bot@chromium.org>2021-05-18 00:24:37 +0000
commit209699018949e695aa99bd807ef7486e28fb0ea3 (patch)
treecdb32d0d3f28953185698647381e53a4e4ae645d
parente38a18d39b0a63428f57ff09a0e0c67ba6472e11 (diff)
downloadchrome-ec-209699018949e695aa99bd807ef7486e28fb0ea3.tar.gz
zephyr: Move watchdog initialization earlier
On CrosEC the watchdog is initialized just after printing banner. Without this change, hangup in eg. vboot hash calculation can result in EC being unresponsive. BUG=none BRANCH=none TEST=Add infinite loop in hash calculation function (efs2.c). Without this change, EC will be unresponsive. With it, watchdog will reboot the EC. Change-Id: I68c33bf79ad9645da55c1782662c19d9cb7cc58d Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897240 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/app/ec/ec_app_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/zephyr/app/ec/ec_app_main.c b/zephyr/app/ec/ec_app_main.c
index e0efb49475..f451f60521 100644
--- a/zephyr/app/ec/ec_app_main.c
+++ b/zephyr/app/ec/ec_app_main.c
@@ -37,6 +37,10 @@ void ec_app_main(void)
system_print_banner();
+ if (IS_ENABLED(CONFIG_PLATFORM_EC_WATCHDOG)) {
+ watchdog_init();
+ }
+
/*
* Keyboard scan init/Button init can set recovery events to
* indicate to host entry into recovery mode. Before this is
@@ -80,10 +84,6 @@ void ec_app_main(void)
*/
k_thread_priority_set(&k_sys_work_q.thread, LOWEST_THREAD_PRIORITY);
- if (IS_ENABLED(CONFIG_PLATFORM_EC_WATCHDOG)) {
- watchdog_init();
- }
-
/* Call init hooks before main tasks start */
if (IS_ENABLED(CONFIG_PLATFORM_EC_HOOKS)) {
hook_notify(HOOK_INIT);