From 808ac2397cc80fcbde695fc0855f938a0f5c1a4d Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Mon, 2 Mar 2020 12:08:32 +0800 Subject: vboot: Set VB2_SD_STATUS_EC_SYNC_COMPLETE in shared data status 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2082756 Reviewed-by: Julius Werner Reviewed-by: Joel Kitching Commit-Queue: Julius Werner --- firmware/2lib/2ec_sync.c | 6 +++--- tests/vb2_ec_sync_tests.c | 8 ++++---- tests/vboot_api_kernel4_tests.c | 6 +++--- 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(); -- cgit v1.2.1