From 027be6fdbbf90ac670dfcbe62c73b852db419015 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Wed, 9 Oct 2013 13:29:26 +0800 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/172380 Reviewed-by: Randall Spangler --- common/vboot_hash.c | 9 ++++----- 1 file 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);