pinhole: no power restore policy on pinhole reset
If the user initiated a BMC reboot via the pinhole reset then do not run
the power restore policy. The pinhole reset is mostly used in debug
situations where a system is having issues. Disabling the power restore
logic helps keep debug simpler.
Tested:
- The overall pinhole reset logic has not been tested on hardware.
- A variety of tests were done within simulation to validate the
different paths in this series of patches
- Full end to end testing will occur once all function is in place due
to the complexities of physically toggling the pinhole reset
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ia656b4872620b6a1fc6ba8f82c01f041d43378a2
diff --git a/discover_system_state.cpp b/discover_system_state.cpp
index 29abdc6..a529a0a 100644
--- a/discover_system_state.cpp
+++ b/discover_system_state.cpp
@@ -69,6 +69,18 @@
// This application is only run if chassis power is off
+ // If the BMC was rebooted due to a user initiated pinhole reset, do not
+ // implement any power restore policies
+ auto bmcRebootCause = phosphor::state::manager::utils::getProperty(
+ bus, "/xyz/openbmc_project/state/bmc0", BMC_BUSNAME, "LastRebootCause");
+ if (bmcRebootCause ==
+ "xyz.openbmc_project.State.BMC.RebootCause.PinholeReset")
+ {
+ info(
+ "BMC was reset due to pinhole reset, no power restore policy will be run");
+ return 0;
+ }
+
/* The logic here is to first check the one-time PowerRestorePolicy setting.
* If this property is not the default then look at the persistent
* user setting in the non one-time object, otherwise honor the one-time