flash: Indicate that erase operation is in progress

Erasing the flash can take a while, by which time the host may have timed
out. So pass an in-progress message back to the host before starting, and
when done, stash the result for later collection.

BUG=chrome-os-partner:12685
BRANCH=snow,link
TEST=manual
build and boot to kernel on snow

Change-Id: I5566a5519a1c8b320573b20e1ea7660217b32a5e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30471
This commit is contained in:
Simon Glass
2012-08-15 14:40:38 -07:00
committed by Gerrit
parent 9d872b724f
commit 8fdf7d5564

View File

@@ -265,6 +265,11 @@ static int flash_command_erase(struct host_cmd_handler_args *args)
if (system_unsafe_to_overwrite(p->offset, p->size))
return EC_RES_ACCESS_DENIED;
/* Indicate that we might be a while */
#ifdef CONFIG_TASK_HOSTCMD
args->result = EC_RES_IN_PROGRESS;
host_send_response(args);
#endif
if (flash_erase(p->offset, p->size))
return EC_RES_ERROR;