Author: Patrick Lin (patrick_lin_wiwynn)
Other contributors: Delphine Chiu(delphinechiu), Bonnie Lo(bonnielo), Ricky Wu(ricky_cx_wu)
Created: Aug 19, 2024
Currently, OpenBMC lacks a unified method that meets the needs of various vendors to record different types of BMC reboot cause event logs. The purpose of this proposal is to update the existing method, consolidating more BMC reboot causes to better align with current usage needs.
In the current approach, the only defined reboot causes are WDIOF_EXTERN1 and WDIOF_CARDRESET, but this is insufficient to meet today's needs. However, due to varying needs among different vendors, it’s not feasible to cover all possible reboot causes. In this update, we will add support for several more common types.
flowchart TD A[BMC reboot] --> B[Driver get the reboot cause] B --> C[Driver set the corresponding flag based on the reboot cause to /sys/class/watchdog/watchdog0/bootstatus] C --> D[phosphor-state-manager get the flag] D --> E[Log the corresponding event based the the different flag]
After a BMC reboot, each BMC vendor’s driver first retrieves the reboot cause. Then, based on the reboot cause, it sets different flags to the specified path. The PSM (Phosphor-state-manager) reads the flags from the specified path to determine the type of reboot cause. Finally, it generates the corresponding event log based on the determination.
This process ensures accurate logging and handling of different BMC reboot causes, improving system reliability and monitoring. Belows are the details of the new additions and changes:
phosphor-state-manager | bootstatus value | watchdog driver |
---|---|---|
WDIOF_EXTERN1 | 0x04 | return 0x04 if reset by Software |
WDIOF_CARDRESET | 0x20 | return 0x20 if reset by Watchdog |
POR | 0x00 | Do nothing |
In the original approach, WDIOF_CARDRESET was used to represent a POR (power-on-reset). However, with the new method, we need to distinguish between watchdog resets and power-on resets. Therefore, we now use WDIOF_CARDRESET to represent watchdog resets, aligning with the existing kernel documentation and driver implementation.
Which repositories are expected to be modified to execute this design? phosphor-state-manager
Reboot the BMC under various conditions and check whether the corresponding event logs are generated correctly.