monitor: Fill in EpowPowerOff action
This action does the following:
1) Starts a service mode timer, which would allow the system to be
serviced before anything happens.
2) On the expiration of that timer, it will:
a) Set the thermal fault alert D-Bus property. This will be used
to send an EPOW alert to the host on IBM systems.
b) Start the meltdown timer.
3) On the expiration of the meltdown timer, a hard power off will
occur. This timer cannot be canceled even if fans start behaving.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I9434699b816b23b68c6d9d1e97283b4ab9befe4f
diff --git a/monitor/power_interface.hpp b/monitor/power_interface.hpp
index 1a339c5..e0a802d 100644
--- a/monitor/power_interface.hpp
+++ b/monitor/power_interface.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "types.hpp"
+
namespace phosphor::fan::monitor
{
@@ -28,6 +30,13 @@
* @brief Perform a hard power off
*/
virtual void hardPowerOff() = 0;
+
+ /**
+ * @brief Sets the thermal alert D-Bus property
+ *
+ * @param[in] alert - The alert value
+ */
+ virtual void thermalAlert(bool alert) = 0;
};
/**
@@ -38,7 +47,7 @@
class PowerInterface : public PowerInterfaceBase
{
public:
- PowerInterface() = default;
+ PowerInterface() = delete;
~PowerInterface() = default;
PowerInterface(const PowerInterface&) = delete;
PowerInterface& operator=(const PowerInterface&) = delete;
@@ -46,6 +55,15 @@
PowerInterface& operator=(PowerInterface&&) = delete;
/**
+ * @brief Constructor
+ *
+ * @param[in] ThermalAlertObject& - The thermal alert D-Bus object
+ */
+ explicit PowerInterface(ThermalAlertObject& alertObject) :
+ _alert(alertObject)
+ {}
+
+ /**
* @brief Perform a soft power off
*/
void softPowerOff() override;
@@ -54,6 +72,22 @@
* @brief Perform a hard power off
*/
void hardPowerOff() override;
+
+ /**
+ * @brief Sets the thermal alert D-Bus property
+ *
+ * @param[in] alert - The alert value
+ */
+ void thermalAlert(bool alert) override
+ {
+ _alert.enabled(alert);
+ }
+
+ private:
+ /**
+ * @brief Reference to the thermal alert D-Bus object
+ */
+ ThermalAlertObject& _alert;
};
} // namespace phosphor::fan::monitor