pseq: Improve power supply error usage
Improve interaction with power supply application by adding a five
second wait after power good failure to allow time for power supply
failure analysis and add use of the passed power supply error if no
voltage fail is found but the power supply error is.
Signed-off-by: Jim Wright <jlwright@us.ibm.com>
Change-Id: I63eab737d0fa785130604025ea7bd048780fbb86
diff --git a/phosphor-power-sequencer/src/ucd90320_monitor.cpp b/phosphor-power-sequencer/src/ucd90320_monitor.cpp
index 518f483..348014c 100644
--- a/phosphor-power-sequencer/src/ucd90320_monitor.cpp
+++ b/phosphor-power-sequencer/src/ucd90320_monitor.cpp
@@ -26,6 +26,7 @@
#include <sdbusplus/bus.hpp>
#include <xyz/openbmc_project/Common/Device/error.hpp>
+#include <chrono>
#include <fstream>
#include <map>
#include <span>
@@ -256,6 +257,10 @@
void UCD90320Monitor::onFailure(bool timeout,
const std::string& powerSupplyError)
{
+ // Wait for five seconds before reading device data. This is to allow the
+ // power supplies and other hardware time to complete failure processing.
+ std::this_thread::sleep_for(std::chrono::seconds(5));
+
std::string message;
std::map<std::string, std::string> additionalData{};
@@ -450,6 +455,12 @@
}
}
}
+ // If no vout failure found, but power supply error is set, use power supply
+ // error
+ if (message.empty())
+ {
+ message = powerSupplyError;
+ }
}
uint16_t UCD90320Monitor::readStatusWord()