diff options
Diffstat (limited to 'firmware/lib')
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 17 | ||||
-rw-r--r-- | firmware/lib/vboot_ui_legacy_clamshell.c | 19 | ||||
-rw-r--r-- | firmware/lib/vboot_ui_legacy_menu.c | 13 |
3 files changed, 6 insertions, 43 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 57a827cb..36bac6ed 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -374,23 +374,18 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, /* Select boot path */ if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) { + vb2_clear_recovery(ctx); + /* - * Clear recovery request and subcode from nvdata, so that we - * don't get stuck in recovery mode after reboot. Should be - * called at some point after we are certain the system does - * not require any reboots for non-vboot-related reasons (e.g. - * FSP initialization), and before triggering a reboot to exit - * transient recovery mode (e.g. memory retraining request). + * Need to commit nvdata changes immediately, since we will be + * entering either manual recovery UI or BROKEN screen shortly. */ - vb2_nv_set(ctx, VB2_NV_RECOVERY_REQUEST, - VB2_RECOVERY_NOT_REQUESTED); - vb2_nv_set(ctx, VB2_NV_RECOVERY_SUBCODE, - VB2_RECOVERY_NOT_REQUESTED); + vb2_commit_data(ctx); /* If we're in recovery mode just to do memory retraining, all we need to do is reboot. */ if (sd->recovery_reason == VB2_RECOVERY_TRAIN_AND_REBOOT) { - VB2_DEBUG("Reboot after retraining in recovery.\n"); + VB2_DEBUG("Reboot after retraining in recovery\n"); rv = VBERROR_REBOOT_REQUIRED; goto VbSelectAndLoadKernel_exit; } diff --git a/firmware/lib/vboot_ui_legacy_clamshell.c b/firmware/lib/vboot_ui_legacy_clamshell.c index cc0c4175..8efcfe9e 100644 --- a/firmware/lib/vboot_ui_legacy_clamshell.c +++ b/firmware/lib/vboot_ui_legacy_clamshell.c @@ -440,25 +440,6 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx) VB2_DEBUG("recovery UI - start\n"); if (!vb2_allow_recovery(ctx)) { - /* - * We have to save the reason here so that it will survive - * coming up three-finger-salute. We're saving it in - * VB2_RECOVERY_SUBCODE to avoid a recovery loop. - * If we save the reason in VB2_RECOVERY_REQUEST, we will come - * back here, thus, we won't be able to give a user a chance to - * reboot to workaround a boot hiccup. - */ - VB2_DEBUG("recovery UI - saving recovery reason (%#x)\n", - sd->recovery_reason); - vb2_nv_set(ctx, VB2_NV_RECOVERY_SUBCODE, sd->recovery_reason); - - /* - * Non-manual recovery mode is meant to be left via three-finger - * salute (into manual recovery mode). Need to commit nvdata - * changes immediately. Ignore commit errors in recovery mode. - */ - vb2_commit_data(ctx); - VbDisplayScreen(ctx, VB_SCREEN_OS_BROKEN, 0, NULL); VB2_DEBUG("recovery UI - waiting for manual recovery\n"); while (1) { diff --git a/firmware/lib/vboot_ui_legacy_menu.c b/firmware/lib/vboot_ui_legacy_menu.c index 2635a7f3..f441b410 100644 --- a/firmware/lib/vboot_ui_legacy_menu.c +++ b/firmware/lib/vboot_ui_legacy_menu.c @@ -837,19 +837,6 @@ vb2_error_t VbBootDeveloperLegacyMenu(struct vb2_context *ctx) /* Main function that handles non-manual recovery (BROKEN) menu functionality */ static vb2_error_t broken_ui(struct vb2_context *ctx) { - VbSharedDataHeader *vbsd = vb2_get_sd(ctx)->vbsd; - - /* - * Temporarily stash recovery reason in subcode so we'll still know what - * to display if the user reboots into manual recovery from here. Commit - * immediately since the user may hard-reset out of here. - */ - VB2_DEBUG("saving recovery reason (%#x)\n", vbsd->recovery_reason); - vb2_nv_set(ctx, VB2_NV_RECOVERY_SUBCODE, vbsd->recovery_reason); - - /* Ignore commit errors in recovery mode. */ - vb2_commit_data(ctx); - enter_recovery_base_screen(ctx); /* Loop and wait for the user to reset or shut down. */ |