mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Shut down after EC software sync if lid is closed
So if the EC reboots when the lid is closed (for example, it wakes
from hibernate because the AC adapter was inserted), it won't leave
the AP powered on.
BUG=chrome-os-partner:11087
TEST=manual
Reboot EC with lid closed ('reboot hard').
Should finish software sync and shut down.
Reboot EC with lid open. Boots.
Hibernate EC and wake with lid open. Boots.
Hibernate EC and wake with power button press. Boots.
Reboot into recovery mode. Boots. Press power button; shuts down.
Reboot into recovery mode. Boots. Close lid; shuts down.
CQ-DEPEND=*22578
Change-Id: I09d5331222aa10b73518f9f574ec5a32d8e6ac23
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28525
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
@@ -422,12 +422,13 @@ VbError_t VbEcSoftwareSync(VbSharedDataHeader *shared) {
|
|||||||
|
|
||||||
VBDEBUG(("VbEcSoftwareSync() in RO-Normal; EC-RO\n"));
|
VBDEBUG(("VbEcSoftwareSync() in RO-Normal; EC-RO\n"));
|
||||||
|
|
||||||
/* TODO: If there was no wake event from the EC (such as power button or
|
/* If shutdown is requested, just power the AP back off. This covers the
|
||||||
* lid-open), shut down. The AP was powered on simply to verify the EC.
|
* case where the lid is closed when then system boots. */
|
||||||
*
|
if (VbExIsShutdownRequested()) {
|
||||||
* Make sure this doesn't shut down when we're leaving recovery mode and
|
VBDEBUG(("VbEcSoftwareSync() sees shutdown-requested\n"));
|
||||||
* jumping back to RW code, though. EC can't currently track that,
|
return VBERROR_SHUTDOWN_REQUESTED;
|
||||||
* though that could be passed as an additional reboot flag to the EC. */
|
}
|
||||||
|
|
||||||
return VBERROR_SUCCESS;
|
return VBERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,12 +530,15 @@ VbError_t VbEcSoftwareSync(VbSharedDataHeader *shared) {
|
|||||||
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
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"));
|
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;
|
return VBERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user