pseq: Use event for power good failure wait
The current 7 second wait after power good failure blocks D-Bus message
processing. Use a systemd event instead to address.
Signed-off-by: Jim Wright <jlwright@us.ibm.com>
Change-Id: I7870fc264f6e5318a980869183bdd8aebfd85810
diff --git a/phosphor-power-sequencer/src/power_control.hpp b/phosphor-power-sequencer/src/power_control.hpp
index 0e37f7e..660b90b 100644
--- a/phosphor-power-sequencer/src/power_control.hpp
+++ b/phosphor-power-sequencer/src/power_control.hpp
@@ -128,6 +128,12 @@
std::chrono::time_point<std::chrono::steady_clock> pgoodTimeoutTime;
/**
+ * Timer to wait after pgood failure. This is to allow the power supplies
+ * and other hardware time to complete failure processing.
+ */
+ sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> pgoodWaitTimer;
+
+ /**
* Poll interval constant
*/
static constexpr std::chrono::milliseconds pollInterval{3000};
@@ -169,6 +175,17 @@
void getDeviceProperties(util::DbusPropertyMap& properties);
/**
+ * Callback to begin failure processing after observing pgood failure wait
+ */
+ void onFailureCallback();
+
+ /**
+ * Begin pgood failute processing
+ * @param timeout if the failure state was determined by timing out
+ */
+ void onFailure(bool timeout);
+
+ /**
* Polling method for monitoring the system power good
*/
void pollPgood();