summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/lib/vboot_api_kernel.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 578031d9..9c5dd7f4 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -422,12 +422,13 @@ VbError_t VbEcSoftwareSync(VbSharedDataHeader *shared) {
VBDEBUG(("VbEcSoftwareSync() in RO-Normal; EC-RO\n"));
- /* TODO: If there was no wake event from the EC (such as power button or
- * lid-open), shut down. The AP was powered on simply to verify the EC.
- *
- * Make sure this doesn't shut down when we're leaving recovery mode and
- * jumping back to RW code, though. EC can't currently track that,
- * though that could be passed as an additional reboot flag to the EC. */
+ /* 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;
}
@@ -529,12 +530,15 @@ VbError_t VbEcSoftwareSync(VbSharedDataHeader *shared) {
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
}
- /* TODO: If there was no wake event from the EC (such as power button or
- * lid-open), shut down. The AP was powered on simply to verify the EC.
- *
- * Make sure this doesn't shut down when we're leaving recovery mode and
- * jumping back to RW code, though. */
VBDEBUG(("VbEcSoftwareSync() in RW; done\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;
}