psu-ng: Fix log error for missing PSU
Fixed missing PSU log error during power on. The issue was replicated
as follow:
1 - Chassis powered off
2 - Remove power cable from PSUx
3 - Remove PSUx from the carrier
4 - Power on chassis
Expect to see error log entry for missing PSUx. Fixed validateConfig to
only restart validationTimeout when there is a input fault and PSU
present or VINUVFault and PSU present.
Test:
1 - System at standby
a - Removed PSU0
b - Reset BMC
c - Power on chassis
d - Verified error logged
2 - System at standby
a - Pull PSU cable
b - Wait 10 seconds
d - Remove PSU and power on the chassis
d - Verified error logged
3 - System at standby
a - Remove power cord from PSU
b - Chassis power on
c - Verified an error is logged
Change-Id: Ife099d2d4871cb5905e4e382180b6b8cce97c66d
Signed-off-by: Faisal Awada <faisal@us.ibm.com>
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 44827ee..2832959 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -978,7 +978,7 @@
for (const auto& psu : psus)
{
- if ((psu->hasInputFault() || psu->hasVINUVFault()))
+ if ((psu->hasInputFault() || psu->hasVINUVFault()) && psu->isPresent())
{
// Do not try to validate if input voltage fault present.
validationTimer->restartOnce(validationTimeout);