psu-ng: Add DEGLITCH_LIMIT, deglitch pgoodFault
While the power supply should not arbitrarily report a PGOOD fault, and
then turn it back off, there is a perception that this is indeed
possible, a glitch of some sort.
To avoid possibly logging an error for an erroneous fault reporting,
make sure the fault is reported more than once before considering it to
be a true fault (deglitch the signal).
Tested:
Real Rainier 2S2U:
Verify tracing PGOOD faults seen and cleared, no error logged
Verify PGOOD/OFF error logged when manually set ON_OFF_CONFIG & OPERATION.
Verify deglitched PGOOD again on restart service (ON_OFF_CONFIG reset).
Change-Id: I54f775004d2e363cff21ff0512bd9283408f1f72
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 5e697e1..ea0d172 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -330,7 +330,7 @@
if ((statusWord & status_word::POWER_GOOD_NEGATED) ||
(statusWord & status_word::UNIT_IS_OFF))
{
- if (!pgoodFault)
+ if (pgoodFault < DEGLITCH_LIMIT)
{
log<level::ERR>(
fmt::format("PGOOD fault: "
@@ -338,9 +338,13 @@
"STATUS_MFR_SPECIFIC = {:#02x}",
statusWord, statusMFR)
.c_str());
- }
- pgoodFault = true;
+ pgoodFault++;
+ }
+ }
+ else
+ {
+ pgoodFault = 0;
}
if (statusWord & status_word::MFR_SPECIFIC_FAULT)
@@ -384,12 +388,12 @@
voutUVFault = false;
fanFault = false;
tempFault = false;
- if (pgoodFault)
+ if (pgoodFault > 0)
{
log<level::INFO>(fmt::format("pgoodFault cleared path: {}",
inventoryPath)
.c_str());
- pgoodFault = false;
+ pgoodFault = 0;
}
}
}
@@ -446,7 +450,7 @@
voutUVFault = false;
fanFault = false;
tempFault = false;
- pgoodFault = false;
+ pgoodFault = 0;
readFail = 0;
try