Handle unexpected power-on during power cycle flow
The current power cycle flow waits for 5 seconds in the off
state before booting and only handles the power cycle timer
event. Due to a boot issue, a system was powering itself on
during this 5 seconds. Since this wasn't handled, power control
ended up in a different state than the actual hardware.
This change adds the same event handlers from the normal system
off state into the power cycle off state so that if the sytem
is powered-on through some other way during the power cycle flow
it is detected and handled correctly.
Tested:
Forced a power-on during a power cycle flow and confirmed that
the system and power-control both end up in the correct state.
Change-Id: I3031135501003eaaa8b469abbc0afc077bd9db9f
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/power-control-x86/src/power_control.cpp b/power-control-x86/src/power_control.cpp
index 4f4d180..d3a2054 100644
--- a/power-control-x86/src/power_control.cpp
+++ b/power-control-x86/src/power_control.cpp
@@ -1570,6 +1570,19 @@
logEvent(__FUNCTION__, event);
switch (event)
{
+ case Event::psPowerOKAssert:
+ powerCycleTimer.cancel();
+ setPowerState(PowerState::waitForSIOPowerGood);
+ break;
+ case Event::sioS5DeAssert:
+ powerCycleTimer.cancel();
+ setPowerState(PowerState::waitForPSPowerOK);
+ break;
+ case Event::powerButtonPressed:
+ powerCycleTimer.cancel();
+ psPowerOKWatchdogTimerStart();
+ setPowerState(PowerState::waitForPSPowerOK);
+ break;
case Event::powerCycleTimerExpired:
psPowerOKWatchdogTimerStart();
setPowerState(PowerState::waitForPSPowerOK);