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>
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 76062f8..54ddb90 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -426,6 +426,7 @@
/* 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 5e2cb89..89f534d 100644
--- a/tests/vb2_misc_tests.c
+++ b/tests/vb2_misc_tests.c
@@ -770,7 +770,7 @@
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();