summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2020-03-02 12:08:32 +0800
committerCommit Bot <commit-bot@chromium.org>2020-03-03 10:19:10 +0000
commit808ac2397cc80fcbde695fc0855f938a0f5c1a4d (patch)
tree19d2a2cb659e0d0ea690cfeea5d27359215c62e9
parent65ce8aeaa052fdfbe5e76ec680c08451e1915e7f (diff)
downloadvboot-stabilize-12951.B.tar.gz
vboot: Set VB2_SD_STATUS_EC_SYNC_COMPLETE in shared data statusstabilize-12951.B
CL:1877066 introduced shared data status VB2_SD_STATUS_EC_SYNC_COMPLETE, but incorrectly saved it in shared data flags. BRANCH=hatch BUG=chromium:1057517 TEST=make runtests Change-Id: Idc993304760c419f80c6b160b30763142cf47234 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2082756 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
-rw-r--r--firmware/2lib/2ec_sync.c6
-rw-r--r--tests/vb2_ec_sync_tests.c8
-rw-r--r--tests/vboot_api_kernel4_tests.c6
3 files changed, 10 insertions, 10 deletions
diff --git a/firmware/2lib/2ec_sync.c b/firmware/2lib/2ec_sync.c
index 684c8905..cba6782e 100644
--- a/firmware/2lib/2ec_sync.c
+++ b/firmware/2lib/2ec_sync.c
@@ -436,10 +436,10 @@ vb2_error_t vb2api_ec_sync(struct vb2_context *ctx)
vb2_error_t rv;
/*
- * If the flags indicate that the EC has already gone through
+ * If the status indicates that the EC has already gone through
* software sync this boot, then don't do it again.
*/
- if (sd->flags & VB2_SD_STATUS_EC_SYNC_COMPLETE) {
+ if (sd->status & VB2_SD_STATUS_EC_SYNC_COMPLETE) {
VB2_DEBUG("EC software sync already performed this boot, skipping\n");
return VB2_SUCCESS;
}
@@ -477,7 +477,7 @@ vb2_error_t vb2api_ec_sync(struct vb2_context *ctx)
return rv;
/* Establish that EC software sync is complete and successful */
- sd->flags |= VB2_SD_STATUS_EC_SYNC_COMPLETE;
+ sd->status |= VB2_SD_STATUS_EC_SYNC_COMPLETE;
return VB2_SUCCESS;
}
diff --git a/tests/vb2_ec_sync_tests.c b/tests/vb2_ec_sync_tests.c
index 5123ea76..eae83b0c 100644
--- a/tests/vb2_ec_sync_tests.c
+++ b/tests/vb2_ec_sync_tests.c
@@ -213,7 +213,7 @@ static void VbSoftwareSyncTest(void)
/* Check flag toggling */
ResetMocks();
test_ssync(VB2_SUCCESS, 0, "Normal sync");
- TEST_NEQ(sd->flags & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
+ TEST_NEQ(sd->status & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
" EC sync complete");
TEST_EQ(ec_ro_updated, 0, " ec ro updated");
TEST_EQ(ec_rw_updated, 0, " ec rw updated");
@@ -226,7 +226,7 @@ static void VbSoftwareSyncTest(void)
TEST_EQ(ec_vboot_done_calls, 1, "ec_vboot_done calls");
ResetMocks();
- sd->flags |= VB2_SD_STATUS_EC_SYNC_COMPLETE;
+ sd->status |= VB2_SD_STATUS_EC_SYNC_COMPLETE;
test_ssync(VB2_SUCCESS, 0, "EC sync already complete");
TEST_EQ(ec_ro_updated, 0, " ec ro updated");
TEST_EQ(ec_rw_updated, 0, " ec rw updated");
@@ -238,7 +238,7 @@ static void VbSoftwareSyncTest(void)
ResetMocks();
ctx->flags &= ~VB2_CONTEXT_EC_SYNC_SUPPORTED;
test_ssync(VB2_SUCCESS, 0, "EC sync not supported");
- TEST_NEQ(sd->flags & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
+ TEST_NEQ(sd->status & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
" EC sync complete");
TEST_EQ(ec_ro_updated, 0, " ec ro updated");
TEST_EQ(ec_rw_updated, 0, " ec rw updated");
@@ -250,7 +250,7 @@ static void VbSoftwareSyncTest(void)
ResetMocks();
gbb.flags |= VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC;
test_ssync(VB2_SUCCESS, 0, "EC sync disabled by GBB");
- TEST_NEQ(sd->flags & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
+ TEST_NEQ(sd->status & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
" EC sync complete");
TEST_EQ(ec_ro_updated, 0, " ec ro updated");
TEST_EQ(ec_rw_updated, 0, " ec rw updated");
diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c
index 1f20cb43..a7c088c0 100644
--- a/tests/vboot_api_kernel4_tests.c
+++ b/tests/vboot_api_kernel4_tests.c
@@ -183,7 +183,7 @@ static void select_and_load_kernel_tests(void)
reset_common_data();
test_slk(0, 0, "Normal");
TEST_EQ(kernel_version, 0x10002, " version");
- TEST_NEQ(sd->flags & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
+ TEST_NEQ(sd->status & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
" EC sync complete");
TEST_FALSE(commit_data_called, " no commit data");
@@ -192,13 +192,13 @@ static void select_and_load_kernel_tests(void)
ctx->flags |= VB2_CONTEXT_EC_SYNC_SUPPORTED;
gbb.flags |= VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC;
test_slk(0, 0, "EC sync disabled by GBB");
- TEST_NEQ(sd->flags & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
+ TEST_NEQ(sd->status & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
" EC sync complete");
reset_common_data();
ctx->flags |= VB2_CONTEXT_EC_SYNC_SUPPORTED;
test_slk(0, 0, "Normal with EC sync");
- TEST_NEQ(sd->flags & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
+ TEST_NEQ(sd->status & VB2_SD_STATUS_EC_SYNC_COMPLETE, 0,
" EC sync complete");
reset_common_data();