summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_api_kernel.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-02-11 10:08:51 -0800
committerChromeBot <chrome-bot@google.com>2013-02-12 10:35:12 -0800
commit886a9047f07d6bf9f424fd83247136c79706e136 (patch)
tree82c35dc1081949aadc6f452324ff1accbe8f033d /firmware/lib/vboot_api_kernel.c
parentfe510c06204c763e61aa36d2263c3b8b79c79879 (diff)
downloadvboot-886a9047f07d6bf9f424fd83247136c79706e136.tar.gz
Software sync checks for shutdown-requested in all code paths
Previously, 1) AP-RO, EC-RO -> checked 2) AP-RW, EC-RO transition to EC-RW -> checked 3) AP-RW, EC-RW already -> NOT checked Now, (3) calls VbExIsShutdownRequested() as well. This fix is needed to avoid inconsistent behavior of software sync after we ship a RW update. Whether we *should* actually shut down or not based on how/why we booted is a separate issue to be addressed by the U-boot implementation of VbExIsShutdownRequested() in a separate CL. BUG=chromium-os:38645 BRANCH=all TEST=make runtests Manual testing also possible - force AP-RW firmware, then reboot with lid closed. Previously, the first boot would shut down because of (2), but subsequent reboots of the AP only wouldn't because of (3). Change-Id: I226202f48d793b88a30ffa62731de878f8c22315 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/43044 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_api_kernel.c')
-rw-r--r--firmware/lib/vboot_api_kernel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 9b596fc2..a55d8064 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -742,6 +742,18 @@ VbError_t VbEcSoftwareSync(VbCommonParams *cparams)
}
VBDEBUG(("VbEcSoftwareSync() in EC-RW and it matches\n"));
+
+ /*
+ * If shutdown is requested, just power the AP back off. This
+ * covers the case where the lid is closed when then system
+ * boots.
+ */
+ if (VbExIsShutdownRequested()) {
+ VBDEBUG(("VbEcSoftwareSync() "
+ "sees shutdown-requested\n"));
+ return VBERROR_SHUTDOWN_REQUESTED;
+ }
+
return VBERROR_SUCCESS;
}