psutils: Enhance PSU Update retry logic
- Update retry logic to align with IBM chart specifications.
- Add firmware file existence check before starting PSU update process.
- Switched log to lg2 in the updater for consistency.
- Fixed device intermittent issue during binding device.
- Modified the update flow to proceed even if the device driver is not
available in sysfs.
These changes improve the robustness of the PSU update process and
enhance logging for better debug isolation.
Test:
- Verified the updater does not start if the firmware file is missing.
- Checked some of the logs correctly reflect the changes using lg2
- Confirmed the PSU binds every time after FW update.
- Test PSU update process continue when the device driver not
available in sysfs.
Change-Id: Iaff5eaf9b9f3ee02d109cf3218f9b0614fa2bd92
Signed-off-by: Faisal Awada <faisal@us.ibm.com>
diff --git a/tools/power-utils/aei_updater.hpp b/tools/power-utils/aei_updater.hpp
index 99127fd..6766077 100644
--- a/tools/power-utils/aei_updater.hpp
+++ b/tools/power-utils/aei_updater.hpp
@@ -82,26 +82,24 @@
/**
* @brief Retrieves the path to the firmware file.
*
- * @return The file path of the firmware.
+ * @return True if successful, false otherwise.
*/
- std::string getFirmwarePath();
+ bool getFirmwarePath();
/**
* @brief Validates the firmware file.
*
- * @param fspath The file path to validate.
* @return True if the file is valid, false otherwise.
*/
- bool isFirmwareFileValid(const std::string& fspath);
+ bool isFirmwareFileValid();
/**
* @brief Opens a firmware file in binary mode.
*
- * @param fspath The path to the firmware file.
* @return A file stream to read the firmware
* file.
*/
- std::unique_ptr<std::ifstream> openFirmwareFile(const std::string& fspath);
+ std::unique_ptr<std::ifstream> openFirmwareFile();
/**
* @brief Reads a block of firmware data from the file.
@@ -184,6 +182,16 @@
bool ispReadRebootStatus();
/**
+ * @brief Create serviceable error
+ *
+ * Place holder for future enhancement
+ */
+ void createServiceableError(const std::string str)
+ {
+ std::cout << "createServiceableError: " << str << "\n";
+ }
+
+ /**
* @brief Pointer to the I2C interface for communication
*
* This pointer is not owned by the class. The caller is responsible for
@@ -201,5 +209,10 @@
* @brief Command block used for writing data to the device
*/
std::vector<uint8_t> cmdBlockWrite;
+
+ /**
+ * @brief The firmware file path
+ */
+ std::string fspath;
};
} // namespace aeiUpdater