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/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 13d9356..68ff7fb 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -250,8 +250,11 @@
"make PowerSupply bus: {} addr: {} driver: {} presline: {}",
*i2cbus, *i2caddr, driver, presline)
.c_str());
- auto psu = std::make_unique<PowerSupply>(bus, invpath, *i2cbus,
- *i2caddr, driver, presline);
+ auto psu = std::make_unique<PowerSupply>(
+ bus, invpath, *i2cbus, *i2caddr, driver, presline,
+ std::bind(
+ std::mem_fn(&phosphor::power::manager::PSUManager::isPowerOn),
+ this));
psus.emplace_back(std::move(psu));
// Subscribe to power supply presence changes