From 72481572aad731b3c2db20c41efb6d5a51812eaa Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Wed, 8 Jan 2014 14:13:23 -0800 Subject: Convert vboot hash calculation from task to deferred function Vboot hash calculation takes ~350 ms during EC boot. Since the hash task is higher priority than the hook task, this starves all the hooks during boot. We could, in theory, fix that simply by swapping the priority of the hook and hash tasks. But then watchdog detection (in the hook task) wouldn't detect hangs in the hash task. A better fix (implemented here) is to convert the hashing operation to a series of deferred function calls. This gets rid of the hash task entirely, and allows all pending hooks and other deferred function calls to take place between each chunk of hashing. On STM32-based boards, we need to bump up the hook task stack size, since hashing is called from several layers deep in the hook task instead of at the top of its own task, but this is still a net win of several hundred bytes of SRAM. BUG=chrome-os-partner:24892 BRANCH=rambi TEST=Boot EC; look for "hash start" and "hash done" debug output. 'taskinfo' shows at least 32 bytes of unused stack for HOOKS task. 'hash ro' runs properly from EC console. Change-Id: I9e580dc10fc0bc8e44896d84451218ef67578bbe Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/181954 --- test/test_config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/test_config.h b/test/test_config.h index 70a3ec72a3..4767d034be 100644 --- a/test/test_config.h +++ b/test/test_config.h @@ -8,6 +8,9 @@ #ifndef __CROS_EC_TEST_CONFIG_H #define __CROS_EC_TEST_CONFIG_H +/* Don't compile vboot hash support unless specifically testing for it */ +#undef CONFIG_VBOOT_HASH + #ifdef TEST_ADAPTER #define CONFIG_CHIPSET_CAN_THROTTLE #define CONFIG_EXTPOWER_FALCO -- cgit v1.2.1