From 8fdf7d5564261cf1f24e375162c5984348ce0595 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 15 Aug 2012 14:40:38 -0700 Subject: [PATCH] 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 Reviewed-on: https://gerrit.chromium.org/gerrit/30471 --- common/flash_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/flash_common.c b/common/flash_common.c index e230ada49c..af7ff919eb 100644 --- a/common/flash_common.c +++ b/common/flash_common.c @@ -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;