Check for essential FRUs
Some FRUs are marked as essential in the inventory JSON, which
implies that those FRUs should be present in the system at
power on.
The commit checks for presence of those FRUs when the system is
powered on.
In case any FRU in the list is found missing, appropriate
PEL is logged.
Also, as it is not possible to say if the reason for GPIO failures
are hardware or firmware related. GPIO PELs has been modified
to just have description and no call outs and to be logged in place.
Commit link for PEL interface:
https://gerrit.openbmc.org/c/openbmc/phosphor-logging/+/54715
'''
Test steps(rainier):
Check for present property for fru path
/xyz/openbmc_project/inventory/system/chassis/motherboard/base_op_panel_blyth
if it is false then proceed else set the property to false using
busctl set-property command.
execute obmcutil poweron
PEL should be logged for missing essential fru.
'''
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: Id8b912503a0086beffa2831910d6852b5e473c15
diff --git a/ibm_vpd_utils.cpp b/ibm_vpd_utils.cpp
index 2eba0b1..cc46aa2 100644
--- a/ibm_vpd_utils.cpp
+++ b/ibm_vpd_utils.cpp
@@ -644,29 +644,6 @@
return str;
}
-/*
- * @brief Log PEL for GPIO exception
- *
- * @param[in] gpioErr gpioError type exception
- * @param[in] i2cBusAddr I2C bus and address
- */
-void logGpioPel(const std::string& gpioErr, const std::string& i2cBusAddr)
-{
- // Get the IIC details
- std::vector<std::string> i2cReg;
- boost::split(i2cReg, i2cBusAddr, boost::is_any_of("-"));
-
- PelAdditionalData additionalData{};
- if (i2cReg.size() == 2)
- {
- additionalData.emplace("CALLOUT_IIC_BUS", i2cReg[0]);
- additionalData.emplace("CALLOUT_IIC_ADDR", "0x" + i2cReg[1]);
- }
-
- additionalData.emplace("DESCRIPTION", gpioErr);
- createPEL(additionalData, PelSeverity::WARNING, errIntfForGpioError);
-}
-
void executePostFailAction(const nlohmann::json& json, const std::string& file)
{
if ((json["frus"][file].at(0)).find("postActionFail") ==
@@ -721,9 +698,12 @@
{
i2cBusAddr =
json["frus"][file].at(0)["postActionFail"]["gpioI2CAddress"];
+ errMsg += " i2cBusAddress: " + i2cBusAddr;
}
- logGpioPel(errMsg, i2cBusAddr);
+ PelAdditionalData additionalData{};
+ additionalData.emplace("DESCRIPTION", errMsg);
+ createPEL(additionalData, PelSeverity::WARNING, errIntfForGpioError);
}
return;
@@ -778,9 +758,14 @@
{
i2cBusAddr =
json["frus"][file].at(0)["presence"]["gpioI2CAddress"];
+ errMsg += " i2cBusAddress: " + i2cBusAddr;
}
- logGpioPel(errMsg, i2cBusAddr);
+ PelAdditionalData additionalData{};
+ additionalData.emplace("DESCRIPTION", errMsg);
+ createPEL(additionalData, PelSeverity::WARNING,
+ errIntfForGpioError);
+
// Take failure postAction
executePostFailAction(json, file);
return false;
@@ -854,9 +839,13 @@
{
i2cBusAddr =
json["frus"][file].at(0)["preAction"]["gpioI2CAddress"];
+ errMsg += " i2cBusAddress: " + i2cBusAddr;
}
- logGpioPel(errMsg, i2cBusAddr);
+ PelAdditionalData additionalData{};
+ additionalData.emplace("DESCRIPTION", errMsg);
+ createPEL(additionalData, PelSeverity::WARNING,
+ errIntfForGpioError);
// Take failure postAction
executePostFailAction(json, file);