summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-10-09 13:29:26 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-14 23:27:11 +0000
commit027be6fdbbf90ac670dfcbe62c73b852db419015 (patch)
tree631d16d7a435d94a0f974e3ebb1d0381220e6a42
parent73589dbb66bdb6051ef82a8f8b8fcd5bd85bd808 (diff)
downloadchrome-ec-027be6fdbbf90ac670dfcbe62c73b852db419015.tar.gz
Return hash status on HAST_START command
On HASH_START command, we should also fill in hash status in response so that the caller sees BUSY status in response. BUG=chrome-os-partner:23067 TEST=Along with u-boot change, corrupting EC RW followed by a warm reset doesn't result in shutdown. BRANCH=All Change-Id: Ie0c1b35d71bc0420b011f0413f92feb88138db4d Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/172380 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/vboot_hash.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/vboot_hash.c b/common/vboot_hash.c
index 68b9876522..abc67ebe00 100644
--- a/common/vboot_hash.c
+++ b/common/vboot_hash.c
@@ -348,16 +348,15 @@ static int host_command_vboot_hash(struct host_cmd_handler_args *args)
return EC_RES_SUCCESS;
case EC_VBOOT_HASH_START:
- return host_start_hash(p);
-
case EC_VBOOT_HASH_RECALC:
rv = host_start_hash(p);
if (rv != EC_RES_SUCCESS)
return rv;
- /* Wait for hash to finish */
- while (in_progress)
- usleep(1000);
+ /* Wait for hash to finish if command is RECALC */
+ if (p->cmd == EC_VBOOT_HASH_RECALC)
+ while (in_progress)
+ usleep(1000);
fill_response(r);
args->response_size = sizeof(*r);