From c335895df7b436ff2076a191f9e6310b9ddf4792 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 4 Nov 2016 18:54:07 -0700 Subject: [PATCH] Cr50: Let NVMEM take more time and memory We were getting occasional stack overflow and watchdog timeouts when clearing NVMEM. Bump up the stack size a bit in the HOOKS task, and pet the watchdog before invoking the tpm2 init functions. BUG=chrome-os-partner:59419 BRANCH=none TEST=make buildall, manual Lock the console, then unlock it. This will reboot the EC & AP, but should never reboot the Cr50. Before this CL, it did about half the time. After, it doesn't. Change-Id: I33adfeb7360bf7d146a55ef16c923a1a0416393d Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/407847 Reviewed-by: Vadim Bendebury --- board/cr50/ec.tasklist | 2 +- common/tpm_registers.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/board/cr50/ec.tasklist b/board/cr50/ec.tasklist index 3d2a4ab1ad..b22bc4e158 100644 --- a/board/cr50/ec.tasklist +++ b/board/cr50/ec.tasklist @@ -17,6 +17,6 @@ * 's' is the stack size in bytes; must be a multiple of 8 */ #define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(HOOKS, hook_task, NULL, CONFIG_STACK_SIZE) \ TASK_NOTEST(TPM, tpm_task, NULL, 8192) \ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) diff --git a/common/tpm_registers.c b/common/tpm_registers.c index ec424202c0..444ed52e20 100644 --- a/common/tpm_registers.c +++ b/common/tpm_registers.c @@ -533,6 +533,8 @@ static void tpm_init(void) /* Create version string to be read by host */ set_version_string(); + watchdog_reload(); + /* * Make sure NV RAM metadata is initialized, needed to check * manufactured status. This is a speculative call which will have to