summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Lai <ericr_lai@compal.corp-partner.google.com>2020-02-19 17:41:38 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-23 15:21:29 +0000
commit024d9c1879dcb808e3e819f485367e0249a18081 (patch)
tree423e215864208be70a563f167e95a5a362d1ec86
parentb2efcbe10010944d0ed6c49e2131d898ee7ea7fe (diff)
downloadvboot-024d9c1879dcb808e3e819f485367e0249a18081.tar.gz
vboot: clear recovery request subcode when recovery UI is reached
CL:2044954 moved clear recovery request into vboot_api_kernel. We'd like to leave the subcode so that we can pipe it through as a UMA statistic. But it's breaking FAFT at the moment. Unconditionally clear it until we have a more detailed design. BUG=b:124141368, b:35576380 TEST=make clean && make runtests BRANCH=none Change-Id: Ib90c746779ca58e0d0100bb0b42a29c2b5a100dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2063198 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: EricR Lai <ericr_lai@compal.corp-partner.google.com>
-rw-r--r--firmware/2lib/2misc.c1
-rw-r--r--tests/vb2_misc_tests.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 76062f89..54ddb900 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -426,6 +426,7 @@ void vb2_clear_recovery(struct vb2_context *ctx)
/* Clear recovery request for both cases. */
vb2_nv_set(ctx, VB2_NV_RECOVERY_REQUEST, VB2_RECOVERY_NOT_REQUESTED);
+ vb2_nv_set(ctx, VB2_NV_RECOVERY_SUBCODE, VB2_RECOVERY_NOT_REQUESTED);
if (!vb2_allow_recovery(ctx)) {
VB2_DEBUG("Stow recovery reason as subcode (%#x)\n",
diff --git a/tests/vb2_misc_tests.c b/tests/vb2_misc_tests.c
index 5e2cb89a..89f534d7 100644
--- a/tests/vb2_misc_tests.c
+++ b/tests/vb2_misc_tests.c
@@ -770,7 +770,7 @@ static void clear_recovery_tests(void)
TEST_EQ(vb2_nv_get(ctx, VB2_NV_RECOVERY_REQUEST),
0, " request cleared");
TEST_EQ(vb2_nv_get(ctx, VB2_NV_RECOVERY_SUBCODE),
- 13, " subcode retained");
+ 0, " subcode cleared");
/* BROKEN recovery */
reset_common_data();