diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2020-11-17 09:14:54 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-19 17:56:10 +0000 |
commit | af0abef50af8858dfa9b1f2b5a2172b88bb3b83e (patch) | |
tree | fd7182192ad893b8937b8f0e5abeef39121802da | |
parent | 6539c0e6a3c110ef9313a656a01af903f73628b2 (diff) | |
download | chrome-ec-af0abef50af8858dfa9b1f2b5a2172b88bb3b83e.tar.gz |
efs2: Disable console task only after task_start is called
Currently, task_disable_task is called even before tasks start
running.
This patch makes EFS2 disable console task only when it's necessary
by checking task_start_called.
BUG=b:170345817, b:173343048
BRANCH=None
TEST=buildall
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Id18039db13f8339cd1c73f838294c24a27553da1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543973
Tested-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | common/vboot/efs2.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/common/vboot/efs2.c b/common/vboot/efs2.c index f0b60e49e0..c196c75d99 100644 --- a/common/vboot/efs2.c +++ b/common/vboot/efs2.c @@ -86,9 +86,12 @@ static enum cr50_comm_err send_to_cr50(const uint8_t *data, size_t size) until.val = get_time().val + CR50_COMM_TIMEOUT; - /* Make sure console task won't steal the response (in case in the - * future we should exchange packets after tasks start). */ - task_disable_task(TASK_ID_CONSOLE); + /* + * Make sure console task won't steal the response in case we exchange + * packets after tasks start. + */ + if (task_start_called()) + task_disable_task(TASK_ID_CONSOLE); /* Wait for response from Cr50 */ for (i = 0; i < sizeof(res); i++) { @@ -103,7 +106,8 @@ static enum cr50_comm_err send_to_cr50(const uint8_t *data, size_t size) } } - task_enable_task(TASK_ID_CONSOLE); + if (task_start_called()) + task_enable_task(TASK_ID_CONSOLE); /* Exit packet mode */ enable_packet_mode(false); |