Fix PSU status when BMC is in standby
Without this patch:
Plug in the power supplies in any order, the power supply that is
plugged in first will report a `PSU_KILL_Fault` in standby, but the
problem will be restored after the host is powered on.
With this patch:
Regardless of whether it is in standby or host powered on, this
problem disappears and it works fine.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I18e0e26a4922dd710e042048625da1cc8b08dd3c
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 2c61f13..d823e68 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -70,10 +70,12 @@
* @param[in] driver - i2c driver name for power supply
* @param[in] gpioLineName - The gpio-line-name to read for presence. See
* https://github.com/openbmc/docs/blob/master/designs/device-tree-gpio-naming.md
+ * @param[in] callback - Get the power on status of the psu manager class
*/
PowerSupply(sdbusplus::bus_t& bus, const std::string& invpath,
std::uint8_t i2cbus, const std::uint16_t i2caddr,
- const std::string& driver, const std::string& gpioLineName);
+ const std::string& driver, const std::string& gpioLineName,
+ std::function<bool()>&& callback);
phosphor::pmbus::PMBusBase& getPMBus()
{
@@ -972,6 +974,14 @@
void updateHistory();
/**
+ * @brief Get the power on status of the psu manager class.
+ *
+ * This is a callback method used to get the power on status of the psu
+ * manager class.
+ */
+ std::function<bool()> isPowerOn;
+
+ /**
* @brief Set to true if INPUT_HISTORY command supported.
*
* Not all power supplies will support the INPUT_HISTORY command. The IBM