#
f566c964 |
| 22-Jul-2024 |
Amithash Prasasd <amithash@meta.com> |
Switch to Use phosphor-dbus-interface defined constants
We are redefining a lot of the constants which are already defined in the phosphor-dbus-interface auto-generated headers. This change switches
Switch to Use phosphor-dbus-interface defined constants
We are redefining a lot of the constants which are already defined in the phosphor-dbus-interface auto-generated headers. This change switches the code to use those instead of allowing compile time definition of those.
Allowing for compile time definition would probably break clients who are not aware of the new paths anyway.
Tested by build a harma image and loading in qemu to test the added interfaces are unchanged. ``` busctl introspect xyz.openbmc_project.State.BMC \ /xyz/openbmc_project/state/bmc0 busctl introspect xyz.openbmc_project.State.Host \ /xyz/openbmc_project/state/host0 busctl introspect xyz.openbmc_project.State.Chassis \ /xyz/openbmc_project/state/chassis0 ```
Change-Id: Ib4c77d2789c13f509b75a2b1837ea454e53e8ae9 Signed-off-by: Amithash Prasasd <amithash@meta.com>
show more ...
|
#
1b2c3c03 |
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Ic16d6d63213bbdd91fcb8f5aa986b66865efda2f Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
695888de |
| 21-Jun-2024 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
clang-tidy: Enable readability-redundant-string-cstr check
This check finds unnecessary calls to std::string::c_str() and std::string::data().
Change-Id: I43e747b95eb042650668da7dd57a8d4b8463426a S
clang-tidy: Enable readability-redundant-string-cstr check
This check finds unnecessary calls to std::string::c_str() and std::string::data().
Change-Id: I43e747b95eb042650668da7dd57a8d4b8463426a Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
#
f15b9544 |
| 21-Jun-2024 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
clang-tidy: Enable modernize-use-nullptr check
This check converts the usage of null pointer constants (e.g. NULL, 0) to use the new C++11 and C23 nullptr keyword.
Change-Id: I8b1dc27f62e8825538d8f
clang-tidy: Enable modernize-use-nullptr check
This check converts the usage of null pointer constants (e.g. NULL, 0) to use the new C++11 and C23 nullptr keyword.
Change-Id: I8b1dc27f62e8825538d8f276c0f99375a1a5d158 Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
#
78c066f6 |
| 13-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
prefer std::format over fmt
Now that std::format is implemented we aren't using complex enough fmt to warrant using it over the std version. Switch to std and remove the dependency.
Signed-off-by:
prefer std::format over fmt
Now that std::format is implemented we aren't using complex enough fmt to warrant using it over the std version. Switch to std and remove the dependency.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib03cdb6a9db4d25de345bdb49b28157880c19bc1
show more ...
|
#
9a286db2 |
| 17-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
reduce dbus string constants
There are a large number of dbus constants scattered throughout the code that could/should be obtained from phosphor-dbus-interface values. Perform minor refactoring to
reduce dbus string constants
There are a large number of dbus constants scattered throughout the code that could/should be obtained from phosphor-dbus-interface values. Perform minor refactoring to greatly reduce the number of string constants.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie8700bc90611d21eee7160f4686bc978fe0a0eb4
show more ...
|
#
0886545d |
| 07-Nov-2023 |
Potin Lai <potin.lai@quantatw.com> |
discover_system_state: apply power restore policy as early as BMC ready
Add a waitBmcReady() to monitor BMC state every second, this function returns true if BMC enters ready state early or returns
discover_system_state: apply power restore policy as early as BMC ready
Add a waitBmcReady() to monitor BMC state every second, this function returns true if BMC enters ready state early or returns flase if timeout reached.
This allows phosphor-diecover-system-state service can perform power restore policy as early as BMC enters ready state.
Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I3f1ef2957c9c8218d094b0e7643dc2eec03535b4
show more ...
|
#
7e969cb9 |
| 23-Aug-2023 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: use non-deprecated namespaces
The sdbusplus repository has deprecated some namespaces and they are currently only enabled with the SDBUSPP_REMOVE_DEPRECATED_NAMESPACE guard. Switch to the
sdbus++: use non-deprecated namespaces
The sdbusplus repository has deprecated some namespaces and they are currently only enabled with the SDBUSPP_REMOVE_DEPRECATED_NAMESPACE guard. Switch to the new namespace names.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9f67e74a02616d8ea2241c18758308f2b669672d
show more ...
|
#
9e5cd389 |
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I2612058799afbcd10f98bd32d2e191b0be7e437b Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
e960184d |
| 03-Mar-2023 |
Potin Lai <potin.lai@quantatw.com> |
discover_system_state: fix ifdef ONLY_RUN_APR_ON_POWER_LOSS always true
ONLY_RUN_APR_ON_POWER_LOSS is defined as 0 or 1 in config.h, it should use `#if ONLY_RUN_APR_ON_POWER_LOSS` instead of `#ifdef
discover_system_state: fix ifdef ONLY_RUN_APR_ON_POWER_LOSS always true
ONLY_RUN_APR_ON_POWER_LOSS is defined as 0 or 1 in config.h, it should use `#if ONLY_RUN_APR_ON_POWER_LOSS` instead of `#ifdef ONLY_RUN_APR_ON_POWER_LOSS`, otherwise it will be true statement all the time.
Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I36d1d0071c0c2c6b3d34d2d9f58d4ea0b4334cb7
show more ...
|
#
70b48f31 |
| 18-Aug-2022 |
Andrew Geissler <geissonator@yahoo.com> |
power-restore: always honor AlwaysOn policy
An internal bug was opened recently noting that when the only-run-apr-on-power-loss config option was set, the AlwaysOn policy was not executed. This didn
power-restore: always honor AlwaysOn policy
An internal bug was opened recently noting that when the only-run-apr-on-power-loss config option was set, the AlwaysOn policy was not executed. This didn't make sense because the AlwaysOn policy is specifically saying to always power the system on. This commit changes the logic to always power on, no matter what, if the user has set the policy to AlwaysOn.
This change fixes a subtle bug in the one-time logic as well. Prior to this change, the one-time setting would always be executed even if the only-run-apr-on-power-loss config option was set. The reasoning behind the bug was that the one-time did need to always be executed, when it was set to AlwaysOn. The one-time is used in situations where host or BMC firmware needs to reboot the BMC but ensure the system boots back up after the BMC reboot (inband code update, brownout conditions). This commit ensures we continue to execute that behavior but also ensures we do not run the one-time otherwise when only-run-apr-on-power-loss is set and there was not an AC loss.
Tested: - Verified AlwaysOn always powered on system - Verified power was only "Restored" when there was an AC loss
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: Ic5ba84cf2d4fe80fc60ebf9440520a80d91c9ed9
show more ...
|
#
27d1e14c |
| 27-Jul-2022 |
NodeMan97 <corey.hardesty@icloud.com> |
Ensure POR reset is logged
In situations where the last reboot cause is not changed to POR, specifically after unexpected AC losses, bmc-state-manager fails to update the property. Therefore after a
Ensure POR reset is logged
In situations where the last reboot cause is not changed to POR, specifically after unexpected AC losses, bmc-state-manager fails to update the property. Therefore after a power cycle the last reboot cause property is set to unknown. Thankfully, chassis-state-manager generates a file indicating an AC loss occurred and that can be used to identify that the last reboot cause was a power-on-cycle. It was necessary to add an "After xyz.openbmc_project.State.Chassis" dependency to bmc-state-managers service file to ensure the AC loss was generated prior to bmc-state-manager executing.
Tested:
- Ensured that when the system was power cycled that the last reboot cause was set to "POR" when the chassis lost power file was present.
- Verified that when the file was not present the last reboot cause was set accordingly (typically unknown)
Change-Id: Ifa6d5d6f89c221477ee2f2fa1ed15adade359e45 Signed-off-by: NodeMan97 <corey.hardesty@icloud.com>
show more ...
|
#
bcbee4a2 |
| 27-May-2022 |
NodeMan97 <corey.hardesty@icloud.com> |
Only run power restore on AC losses
Added a meson build option that allows the customer to enable automatic power restore policy only for AC losses where the chassis power was on prior to a BMC rese
Only run power restore on AC losses
Added a meson build option that allows the customer to enable automatic power restore policy only for AC losses where the chassis power was on prior to a BMC reset(and off when it comes back online).
The default is set to 'false' which provides the standard behavior of APR which is to always run APR on an BMC reboot. If the option 'only-run-apr-on-power-loss' is 'true' then APR is only run in the case of the chassis losing power. AC power losses trigger the creation of a file called 'chassis@0-lost-power' that identifies an AC power loss has occurred. This generated file can be found in the directory '/run/openbmc/'.
Tested: - Verified that when built with option 'only-run-apr-on-power-loss' set to false(default) that APR was ran. - Verified that when built with option 'only-run-apr-on-power-loss' set to true that apr was not ran when a power loss did not occur. - Verified that when built with option 'only-run-apr-on-power-loss' set to true that apr was only ran when a power loss occured.
Jun 08 01:55:13 p10bmc phosphor-chassis-state-manager[3009]: The system suffered a power blackout.
root@p10bmc:/lib/systemd/system# ls /run/openbmc/ chassis@0-lost-power
Signed-off-by: Corey Hardesty <corey.hardesty@icloud.com> Change-Id: Iac37761416d699e3a469936e00868a8d9b6dfdb1
show more ...
|
#
358de95e |
| 20-Jul-2022 |
NodeMan97 <corey.hardesty@icloud.com> |
Utilization of power restore delay for APR
There was an issue where APR would start too early in the boot process causing conflicts between the BMC and host firmware on the i2c buses. Waiting to run
Utilization of power restore delay for APR
There was an issue where APR would start too early in the boot process causing conflicts between the BMC and host firmware on the i2c buses. Waiting to run APR ensures the BMC reaches a READY state and that the vpd collection has completed. This commit adds a delay based off of the value of 'PowerRestoreDelay' a Dbus property hosted by the RestorePolicy interface. The system owners may override this value which is initially defaulted to 0 via an override in their meta layer.
Tested: - Ran an AC cycle of the system and restarted phosphor-discover- system-state@0.service.
- Ensure that the bmc reboot was delayed by the value specified by PowerRestoreDelay.
- Verified through on real hardware. Simulation environment has system noise that create unpredictable delay results with delays over 15 seconds. The delays in simulation always adhere to the property, but take additional time to boot.
- PowerRestoreDelay at 30 seconds (ran 5 separate times) systemctl stop phosphor-discover-system-state@0.service
Jul 22 17:47:23 p10bmc phosphor-discover-system-state[2224]: power_policy=Restore, powering host on (30s delay)
Jul 22 17:47:53 p10bmc systemd[1]: Finished Reboot If Enabled
5/5 tests were delayed exactly 30 seconds.
- PowerRestoreDelay at 100 seconds
Jul 22 17:52:45 p10bmc phosphor-discover-system-state[2224]: power_policy=Restore, powering host on (100s delay)
Jul 22 17:54:25 p10bmc systemd[1]: Finished Reboot If Enabled.
1/1 test(s) were delayed exactly 100 seconds.
- PowerRestoreDelay at 0 seconds
Jul 22 18:02:51 p10bmc phosphor-discover-system-state[2271]: power_policy=Restore, powering host on (30s delay)
Jul 22 18:02:51 p10bmc systemd[1]: Finished Reboot If Enabled.
Signed-off-by: Corey Hardesty <corey.hardesty@icloud.com> Change-Id: I69f7f9f3a9e638defcbee2bbb8dda6d9c4b7f0ae
show more ...
|
#
744fe627 |
| 21-Jul-2022 |
NodeMan97 <corey.hardesty@icloud.com> |
Power restore from last state after AC Loss
In situations where the power restore policy was set to Restore from the last known state (Restore) and the requested host transition was not denoted as "
Power restore from last state after AC Loss
In situations where the power restore policy was set to Restore from the last known state (Restore) and the requested host transition was not denoted as "On" would lead to the host never powering back on. For example, this occurs during a fresh boot of a system or after completing a system update where other RequestedHostTransition properties may be set such as 'GracefulWarmReboot'. This lead to the old logic in discover system state to never power the host back on which means there was a potential that users would have to manually power back on the host. This change inverts the logic, essentially checking to ensure the 'RequestedHostTransition' was not set to off and therefore indicating that power should be restored in all other cases (per the interface documentation).
Tested: - All testing was with PowerRestorePolicy as 'Restore' The corresponding gui option is 'LastState'.
- Applied changes and ensured that power was restored to the host with 'GracefulWarmReboot' set as the desired host transition property.
- Set 'RequestedHostTransition' property to "Reboot", "GraceFulWarmReboot", "ForcedWarmReboot" and verified that chassis power state was restored to 'On' after a power cycle.
- Confirmed that with any of the transition properties listed above set that the 'RequestedHostTransition' state switched to on after reboot.
- Verified that power state remained off when the 'RequestedHostTransition' property was set to 'Off'. Also that this property remained 'Off' after reboot.
Signed-off-by: Corey Hardesty <corey.hardesty@icloud.com> Change-Id: Ie582bf16b51a4cbc0c3c8b3016e3ed9e5f59cb80
show more ...
|
#
f053e6fe |
| 22-Jul-2022 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I41103c892db258a85640aa1442acd9a295c8a847
show more ...
|
#
c328a4cf |
| 18-Mar-2022 |
Potin Lai <potin.lai@quantatw.com> |
discover-system-state: add multi-host support
Add HostObjects class to fetch paths of settings d-bus objects under /xyz/openbmc_project/control/hostX .
Signed-off-by: Potin Lai <potin.lai@quantatw.
discover-system-state: add multi-host support
Add HostObjects class to fetch paths of settings d-bus objects under /xyz/openbmc_project/control/hostX .
Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I1dc55ec389e94e6c85aa7031b304f8c4ed15dc71
show more ...
|
#
b669ea30 |
| 22-Feb-2022 |
Thang Q. Nguyen <thang@os.amperecomputing.com> |
no power restore policy on cold reset
Per the IPMI Specification v2.0 revision 1.1, section 2.28, "the power restore policy determines how the system or chassis behaves when AC power returns after a
no power restore policy on cold reset
Per the IPMI Specification v2.0 revision 1.1, section 2.28, "the power restore policy determines how the system or chassis behaves when AC power returns after an AC power loss". This means if the user initiated a BMC reboot via the reboot command from BMC console or "ipmitool mc reset cold", the Host state should not be affected. This commit adds condition to check if BMC boots from the reboot command to disable the power restore policy.
Tested: - Reboot BMC via command line "reboot" command. - Do A/C power and check if power restore policy executes properly.
Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com> Change-Id: I22f5520dd09c124ac570f62a1b8604a6ee4235ea
show more ...
|
#
6810ad50 |
| 23-Feb-2022 |
Thang Tran <thuutran@amperecomputing.com> |
check requested state before update properties
When the power policy is "Restore" or "Always-Off", software only updates properties if current requested state is "On". This action is necessary to av
check requested state before update properties
When the power policy is "Restore" or "Always-Off", software only updates properties if current requested state is "On". This action is necessary to avoid redundant tasks when AC power.
Tested: 1. Turn Off the HOST and set power policy to Always-Off ipmitool chassis power off ipmitool chassis policy always-off 2. AC power, wait until BMC has been rebooted. 3. HOST is OFF, check journalctl log. BMC did not request to update requested state. 4. Turn On the HOST, AC power, wait until BMC has been rebooted. 5. HOST is OFF, check journalctl log. BMC requests to update requested state to "Off". 6. Set power policy to Previous. ipmitool chassis policy previous 7. AC power, wait until BMC has been rebooted. 8. HOST is OFF, check journalctl log. BMC did not request to update requested state. 9. Turn On the HOST, AC power, wait until BMC has been rebooted. 10. HOST is ON, check journalctl log. BMC requests to update requested state to "On".
Signed-off-by: Thang Tran <thuutran@amperecomputing.com> Change-Id: I14f89d7cdd3911dc74f693aadb60ae04e6819bc2
show more ...
|
#
d93da775 |
| 21-Feb-2022 |
Andrew Geissler <geissonator@yahoo.com> |
add namespace on setProperty
The function was moved to a utility interface so need the namespace added
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: Ia6fccbec909ad83bd5f1d6a335b
add namespace on setProperty
The function was moved to a utility interface so need the namespace added
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: Ia6fccbec909ad83bd5f1d6a335b1dc55948d2bfe
show more ...
|
#
b2b3d9c2 |
| 26-Jan-2022 |
Andrew Geissler <geissonator@yahoo.com> |
pinhole: no power restore policy on pinhole reset
If the user initiated a BMC reboot via the pinhole reset then do not run the power restore policy. The pinhole reset is mostly used in debug situati
pinhole: no power restore policy on pinhole reset
If the user initiated a BMC reboot via the pinhole reset then do not run the power restore policy. The pinhole reset is mostly used in debug situations where a system is having issues. Disabling the power restore logic helps keep debug simpler.
Tested: - The overall pinhole reset logic has not been tested on hardware. - A variety of tests were done within simulation to validate the different paths in this series of patches - Full end to end testing will occur once all function is in place due to the complexities of physically toggling the pinhole reset
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: Ia656b4872620b6a1fc6ba8f82c01f041d43378a2
show more ...
|
#
49e6713a |
| 26-Jan-2022 |
Andrew Geissler <geissonator@yahoo.com> |
pinhole: move power policy service to utils
Move the getProperty() function to utils and use it for all utility functions
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I3128d600
pinhole: move power policy service to utils
Move the getProperty() function to utils and use it for all utility functions
Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I3128d6006dc5f72a579daaf168b9976ee5bcb2e8
show more ...
|
#
1fc48456 |
| 08-Feb-2022 |
Thang Tran <thuutran@amperecomputing.com> |
set requested state to off when power policy is always-off
Issue: Step 1: Set the power policy to "always-on" then turn off/on the chassis power. HOST shall be turned on after BMC has been rebooted.
set requested state to off when power policy is always-off
Issue: Step 1: Set the power policy to "always-on" then turn off/on the chassis power. HOST shall be turned on after BMC has been rebooted. Step 2: Set the power policy to "always-off" then turn off/on the chassis power. HOST shall be turn off after BMC has been rebooted. Step 3: Set the power policy to "previous" then turn off/on the chassis power. Wait until BMC has been rebooted. Expect: At step 3, HOST should be turned off due to BMC turned off HOST in step 2. Actual: At step 3, HOST is turned on.
Root cause: In step 1, BMC updated the requested state to "On". But in step 2, BMC did not update requested state to "Off", it is still "On". Therefore, in step 3, when BMC check the requested state (it is being "On"), BMC turns on the HOST.
Solution: When power policy is "always-off", set the requested state to "Off".
Tested: Repeat 3 above steps, at step 3, HOST state is "Off"
Signed-off-by: Thang Tran <thuutran@amperecomputing.com> Change-Id: Ib50de99ae935f2ccb777226d78848e33e5db9906
show more ...
|
#
744e5617 |
| 03-Dec-2021 |
Andrew Geissler <geissonator@yahoo.com> |
host-restart: set restart reason on power policy use When the power policy is the reason for a power on of the system, set the RestartCause property appropriately. This property
host-restart: set restart reason on power policy use When the power policy is the reason for a power on of the system, set the RestartCause property appropriately. This property is used by other software on some systems to guide partition behaviors in the host code. Tested: - Set boot policy to Power.RestorePolicy.Policy.AlwaysOn and Power.RestorePolicy.Policy.Restore, verified RestartCause updated to expected value. Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: Ie3484d02e357e0b8f0c81d6abedda5b6f7d66cb5
show more ...
|
#
8ffdb269 |
| 20-Sep-2021 |
Andrew Geissler <geissonator@yahoo.com> |
lg2: convert state-manager This converts the rest of phosphor-state-manager over to the lg2 interface. Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I387
lg2: convert state-manager This converts the rest of phosphor-state-manager over to the lg2 interface. Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I3878ec950b6a2b1ada93544cc021cecf14edfb46
show more ...
|