Improve initialization of I2C sensors
After an AC cycle validation has witnessed some systems sensors are
missing. As Entity Manager begins the process of scanning for
sesnsors, and creating the hardware monitoring nodes, there are
occassionally some failures to correctly create the node. This
manifests itself by the 'dd' kernel driver emitting an -EBUSY error
message. Unfortunately the 'dd' driver also eats the error code, and
continues. This is by design.
This commit modifies how the nodes are initialized. The steps taken:
1. Determine if the node is already present
2. Create the node if it is not
3. Set a timer, to give the kernel time to create the node
4. For those sensors that create a "hwmon" subdir, search for that
directory after the timer elapses.
5. If the subdir is not present, delete the device, and try again by
initiating another timer.
6. Continue until the subdir exists, or a retry count expires.
Tested:
Ran AC cycles via a script.
After each cycle, wait for the SUT to DC on, and arrive at the EFI
Shell> prompt.
Issue "ipmitool sensor list", capturing the results
Search the list for all of the sensors that have been reported as
missing after AC cycles.
Change-Id: I118df674162677d66e7d211b089430fce384086b
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/include/Utils.hpp b/include/Utils.hpp
index 657af92..0aff148 100644
--- a/include/Utils.hpp
+++ b/include/Utils.hpp
@@ -30,6 +30,8 @@
constexpr const char* versionHashFile = "/var/configuration/version";
constexpr const char* versionFile = "/etc/os-release";
+extern boost::asio::io_context io;
+
using BasicVariantType =
std::variant<std::string, int64_t, uint64_t, double, int32_t, uint32_t,
int16_t, uint16_t, uint8_t, bool, std::vector<uint8_t>>;