psu-ng: Include STATUS_INPUT in input fault error
Read the value of STATUS_INPUT if STATUS_WORD is not zero. Include the
value of STATUS_INPUT if logging an error for an input fault.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I0463377a3e67faf1f32ab4a4b30ff73cbb8f5631
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 9d8c914..64e0f26 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -208,16 +208,17 @@
if (statusWord)
{
+ statusInput = pmbusIntf->read(STATUS_INPUT, Type::Debug);
statusMFR = pmbusIntf->read(STATUS_MFR, Type::Debug);
if (statusWord & status_word::INPUT_FAULT_WARN)
{
if (!inputFault)
{
log<level::INFO>(
- fmt::format("INPUT fault: "
- "STATUS_WORD = {:#04x}, "
- "STATUS_MFR_SPECIFIC = {:#02x}",
- statusWord, statusMFR)
+ fmt::format("INPUT fault: STATUS_WORD = {:#04x}, "
+ "STATUS_MFR_SPECIFIC = {:#02x}, "
+ "STATUS_INPUT = {:#02x}",
+ statusWord, statusMFR, statusInput)
.c_str());
}
@@ -245,10 +246,10 @@
if (!vinUVFault)
{
log<level::INFO>(
- fmt::format("VIN_UV fault: "
- "STATUS_WORD = {:#04x}, "
- "STATUS_MFR_SPECIFIC = {:#02x}",
- statusWord, statusMFR)
+ fmt::format("VIN_UV fault: STATUS_WORD = {:#04x}, "
+ "STATUS_MFR_SPECIFIC = {:#02x}, "
+ "STATUS_INPUT = {:#02x}",
+ statusWord, statusMFR, statusInput)
.c_str());
}