New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 793061 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

ec: Consider removing CONFIG_FLASH_DEFERRED_ERASE

Project Member Reported by sha...@chromium.org, Dec 7 2017

Issue description

We're defining CONFIG_FLASH_DEFERRED_ERASE for stm32f76x / stm32f446, probably due to large flash size and long sector erase time on those parts.

My main problem with CONFIG_FLASH_DEFERRED_ERASE is that it implements a second method of asynchronous flash erase (CONFIG_HOST_COMMAND_STATUS / EC_RES_IN_PROGRESS is method #1, it uses the hostcmd task rather than a deferred function). Ideally the host should be able to specify the erase method as one of the following:

- Synchronous / wait for completion (even though it may take a while).
- Asynchronous / return EC_RES_IN_PROGRESS, check status with STATUS command.
- Don't care / let the EC decide (this is how FLASH_ERASE_SECTOR works today).


I realize that kicking off flash erase after 100ms may solve some problems with instruction fetch being down during erase, but eventually we will have to pay that cost, kicking it 100ms later is not necessarily safe either. The host needs to be aware that EC_CMD_FLASH_ERASE in async. mode may lead to increased interrupt latency, and increase its timeouts accordingly, until the erase completes.
 
Let's remove EC_RES_IN_PROGRESS: it blocks all EC commands while erase is in progress: in kernel send_command, we run EC_CMD_GET_COMMS_STATUS until the command result is not in progress anymore. [v4.4/drivers/platform/chrome/cros_ec_proto.c, line 70], from https://chromium-review.googlesource.com/170748, related bug b:35523554 and b:35526300

For instance, if flashrom erase the memory and the another thread do a ectool info, the latter will be blocked.

CONFIG_FLASH_DEFERRED_ERASE place the burden of checking on the app, not the kernel.

Sign in to add a comment