pldm: Build BIOS Table Lazily
Entity manager service hosts the compatible interface and populates the
Names property with the chassis type. It is seen that the Names property
is updated pretty late on the way to BMC ready state. And by that time
pldmd is already creating the bios table assuming that the system type
is not detected.
To fix this behavior, rather than creating the bios table early, we need
to wait until we get the system type from the entity manager daemon.
System Type is fetched from Entity Manager Decorator.Compatible
interface [1].
PLDM registers the service name only after building the BIOS tables, to
avoids failures to bios updates from other applications
Tested: Power off/On successfully in Simulator
[1] https://github.com/openbmc/entity-manager/commit/9bac6409d4bd684f058517f41de33ba1d17e5666
Change-Id: I4d431061eaaf8842f6382c2e83807f725653e19b
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/libpldmresponder/platform_config.hpp b/libpldmresponder/platform_config.hpp
index 265a419..3934c61 100644
--- a/libpldmresponder/platform_config.hpp
+++ b/libpldmresponder/platform_config.hpp
@@ -19,6 +19,8 @@
"xyz.openbmc_project.Inventory.Decorator.Compatible";
static constexpr auto namesProperty = "Names";
+using SystemTypeCallback = std::function<void(const std::string&)>;
+
class Handler : public CmdHandler
{
public:
@@ -32,9 +34,10 @@
"xyz.openbmc_project.EntityManager"),
std::bind(&Handler::systemCompatibleCallback, this,
std::placeholders::_1));
+ sysTypeCallback = nullptr;
}
- /** @brief Interface to get the system type information
+ /** @brief Interface to get the system type information using Dbus query
*
* @return - the system type information
*/
@@ -43,12 +46,18 @@
/** @brief D-Bus Interface added signal match for Entity Manager */
void systemCompatibleCallback(sdbusplus::message_t& msg);
+ /** @brief Registers the callback from other objects */
+ void registerSystemTypeCallback(SystemTypeCallback callback);
+
private:
/** @brief system type/model */
std::string systemType;
/** @brief D-Bus Interface added signal match for Entity Manager */
std::unique_ptr<sdbusplus::bus::match_t> systemCompatibleMatchCallBack;
+
+ /** @brief Registered Callback */
+ SystemTypeCallback sysTypeCallback;
};
} // namespace platform_config