History log of /openbmc/phosphor-state-manager/bmc_state_manager.cpp (Results 1 – 25 of 46)
Revision Date Author Comments
# 9f38152a 17-Oct-2024 Thang Tran <thuutran@amperecomputing.com>

reject Transition request while firmware being flashed

When users request to flash BMC/Host... firmware, the BMC should reject
turning on the host or rebooting BMC requests to protect the system.
As

reject Transition request while firmware being flashed

When users request to flash BMC/Host... firmware, the BMC should reject
turning on the host or rebooting BMC requests to protect the system.
As defined in the PDIs [1], the ActivationBlocksTransition interface is
used to prevent power-on during flashing. The phosphor-state-manager
shall look for this interface to make decision should transition request
is executed or not. When BMC rejects the transition request, an error is
thrown as defined in PDIs [2].

[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Software/ActivationBlocksTransition.interface.yaml
[2] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/75231

Tested:
Enable check-fwupdate-before-do-transition option
1. Request to flash Host's firmware via Redfish or WebUi
2. Request to turn off the Host.
$ipmitool power off
3. BMC turns off the power.
4. Request to turn on the Host.
$ipmitool power on
5. BMC rejects above request. No power action is executed.
6. Request to reboot BMC.
$ipmitool mc reset cold
7. BMC did not reboot.
8. Request turn on the Host after flashing done.
9. BMC turns on the Power.
10. Request to reboot BMC.
11. BMC reboots.

Disable check-fwupdate-before-do-transition option
1. Request to flash Host's firmware via Redfish or WebUi
2. Request to turn off the Host.
$ipmitool power off
3. BMC turns off the power.
4. Request to turn on the Host.
$ipmitool power on
5. BMC does not reject this request, but no power action is handled
6. When flashing done, BMC turns on the power.

Change-Id: If3998e58d24cfb72d13b01eb5b8c8cc5a39b3c95
Signed-off-by: Thang Tran <thuutran@amperecomputing.com>

show more ...


# 4ab59214 04-Sep-2024 Tim Lee <timlee660101@gmail.com>

bmc-state-manager: revise BMC reboot cause

According new design from below commit:
https://gerrit.openbmc.org/c/openbmc/docs/+/73678

We need to revise `RebootCause` value as below:

`WDIOF_EXTERN1`

bmc-state-manager: revise BMC reboot cause

According new design from below commit:
https://gerrit.openbmc.org/c/openbmc/docs/+/73678

We need to revise `RebootCause` value as below:

`WDIOF_EXTERN1` => `RebootCause::Software`
`WDIOF_CARDRESET` => `RebootCause::Watchdog`

Tested:
busctl get-property xyz.openbmc_project.State.BMC \
/xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC \
LastRebootCause

When unplug/plug in BMC power cable then return as below:
s "xyz.openbmc_project.State.BMC.BMCResetCause.POR"

When executing reboot command then return as below:
s "xyz.openbmc_project.State.BMC.BMCResetCause.Software"

When kernel panic watchdog be triggered then return as below:
s "xyz.openbmc_project.State.BMC.BMCResetCause.Watchdog"

Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: Iba7dfe6822d5f2f595c19e77aa559bb3b0a9d69c

show more ...


# b594ac12 21-Jun-2024 Pavithra Barithaya <pavithrabarithaya07@gmail.com>

clang-tidy: Enable readability-braces-around-statements check

This checks that bodies of if statements and loops
(for, do while, and while) are inside braces.

Change-Id: Ia5924cc4e9dca98cc29bbaa509

clang-tidy: Enable readability-braces-around-statements check

This checks that bodies of if statements and loops
(for, do while, and while) are inside braces.

Change-Id: Ia5924cc4e9dca98cc29bbaa50923e3269db22089
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>

show more ...


# 319eda48 21-Jun-2024 Pavithra Barithaya <pavithrabarithaya07@gmail.com>

clang-tidy: Enable readability-qualified-auto check

This check aims to improve code readability by suggesting the use
of const auto * instead of auto for variables that are pointers
or iterators. Th

clang-tidy: Enable readability-qualified-auto check

This check aims to improve code readability by suggesting the use
of const auto * instead of auto for variables that are pointers
or iterators. This helps clarify the const-ness of the pointed-to
object or container elements.

Change-Id: I5fa46006aa5669834ebb144d32014f8882e563e3
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>

show more ...


# 47120841 09-Jan-2024 Willy Tu <wltu@google.com>

bmc-state: Add property signal for lastRebootTime

This sends the changedProperty signal for lastRebootTime when it is
updated via the timesync signal. It will allow us to use the correct
lastRebootT

bmc-state: Add property signal for lastRebootTime

This sends the changedProperty signal for lastRebootTime when it is
updated via the timesync signal. It will allow us to use the correct
lastRebootTime instead of the pre-sync time.

Change-Id: I7c651e28de2bb3f2b86746e043dcaa2def0a6bc3
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# bd1eebd9 05-Oct-2023 Willy Tu <wltu@google.com>

bmc_state: Update last update time after timesync

Currently the lastRebootTime is updated at service boot up and reuses
the values on future requests. This can cause incorrect values like

```
$ bus

bmc_state: Update last update time after timesync

Currently the lastRebootTime is updated at service boot up and reuses
the values on future requests. This can cause incorrect values like

```
$ busctl get-property xyz.openbmc_project.State.BMC /xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC LastRebootTime
t 1680555476000
$ uptime
11:23:05 up 1 day, 24 min, load average: 3.08, 2.89, 2.84
```

1680555476000 -> Mon Apr 03 2023 20:57:56 GMT+0000
which is more than 1 day and 24 minutes ago.

The change will detect property changes to `time-sync.target` which
would be activated after timesync happens. It will then deactivate the
matcher after update the lastReboot time once.

Tested:
After bootup and timesync, the lastReboot time is now correct.

Change-Id: Iee8a0bc9f0c5b22d5010f1a677011e44b5d425d3
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# 564eb4fa 07-Sep-2023 Willy Tu <wltu@google.com>

Set lastRebootTime once at startup only

The lastRebootTime doesn't change once the daemon starts, so we only
need to fetch the info once and save the time instead of calculating it
everytime.

Chang

Set lastRebootTime once at startup only

The lastRebootTime doesn't change once the daemon starts, so we only
need to fetch the info once and save the time instead of calculating it
everytime.

Change-Id: I5e665d637f122727be9bb8f0e7b731d75a567f02
Signed-off-by: Willy Tu <wltu@google.com>

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 ...


# 2038e492 16-Jun-2023 Andrew Geissler <geissonator@yahoo.com>

reboot-cause: look for pinhole reset first

A pinhole reset is usually a users last try and recovering a hung
system. On some systems, a pinhole reset will result in both a BMC reset
and a power off

reboot-cause: look for pinhole reset first

A pinhole reset is usually a users last try and recovering a hung
system. On some systems, a pinhole reset will result in both a BMC reset
and a power off to the chassis. Need to ensure the real reason is
recorded so look for the pinhole reset first before looking to see if an
AC loss has occurred.

Testing:
- None, logic seems fairly obvious

Change-Id: I51f41620df2a2f99469ec8fdcba2e464a7711d82
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>

show more ...


# 928bbf15 14-Feb-2023 Andrew Geissler <geissonator@yahoo.com>

move systemd subscribe to util function

This code is replicated in multiple source files in this repo, put it in
the util repo so everyone can call it in one place.

Tested:
- Verified systemd signa

move systemd subscribe to util function

This code is replicated in multiple source files in this repo, put it in
the util repo so everyone can call it in one place.

Tested:
- Verified systemd signals seen and system boots

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I8bf0343c79012cc91dea033038894a011fd37ef5

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 ...


# 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 ...


# e4bdc7c6 25-May-2022 Andrew Geissler <andrewg@us.ibm.com>

update to latest openbmc clang format standards

Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
Change-Id: Ibb0e97e8850bbd3c1eff82f4630328e2b5d15220


# 4ee59466 28-Apr-2022 Andrew Geissler <geissonator@yahoo.com>

bmc-reboot: put into NotReady state

When a reboot of the BMC has been requested, there is a period of time
where certain services, like the BMC webserver, are still running. This
can be confusing to

bmc-reboot: put into NotReady state

When a reboot of the BMC has been requested, there is a period of time
where certain services, like the BMC webserver, are still running. This
can be confusing to external clients that do not know the BMC reboot is
occurring and who are still expecting the BMC interfaces (like Redfish)
to continue working. Provide at least a cookie crumb to external clients
by switching the BMC state to NotReady when a BMC reboot is initiated.

This allows client a method to read the BMC state via the redfish
managers API and know the state of the BMC.

Tested:
- Verified when I initiated a reboot of the BMC via the
RequestedBMCTransition property that the BMC state was set to
NotReady

Apr 28 20:12:53 witherspoon phosphor-bmc-state-manager[337]: Setting the RequestedBMCTransition field to xyz.openbmc_project.State.BMC.Transition.Reboot
Apr 28 20:12:53 witherspoon phosphor-bmc-state-manager[337]: Setting the BMCState field to xyz.openbmc_project.State.BMC.BMCState.NotReady
... <BMC rebooted>
Apr 28 20:15:27 witherspoon phosphor-bmc-state-manager[349]: Setting the BMCState field to BMC_NOTREADY
Apr 28 20:15:27 witherspoon phosphor-bmc-state-manager[349]: Setting the BMCState field to xyz.openbmc_project.State.BMC.BMCState.NotReady
Apr 28 20:15:27 witherspoon phosphor-bmc-state-manager[349]: Setting the RebootCause field to xyz.openbmc_project.State.BMC.RebootCause.Unknown
Apr 28 20:15:57 witherspoon phosphor-bmc-state-manager[349]: BMC_READY
Apr 28 20:15:57 witherspoon phosphor-bmc-state-manager[349]: Setting the BMCState field to xyz.openbmc_project.State.BMC.BMCState.Ready

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I97b1191769390e7774fb1d3714e8b3f742838f6a

show more ...


# 8c26f0ea 27-Apr-2022 NodeMan97 <corey.hardesty@icloud.com>

bmc-quiesce: ensure bmc stays in quiesce

Removed redundant signal changes when bmc is in quiesced state.
The system state signal should be reset in order to avoid any
potential changes.

Tested:

bmc-quiesce: ensure bmc stays in quiesce

Removed redundant signal changes when bmc is in quiesced state.
The system state signal should be reset in order to avoid any
potential changes.

Tested:
-Ran in a Docker container using the build unit-test script.
-Built and tested in simics. After setting the bmc's state
to quiesced I then attempted to start the bmc to change it's
state. I verified the intended functionality with obmcutil
and received the expected output.

root@p10bmc:~# systemctl start obmc-bmc-service-quiesce@0.target
root@p10bmc:~# systemctl start multi-user.target
root@p10bmc:~# obmcutil state
CurrentBMCState: xyz.openbmc_project.State.BMC.BMCState.Quiesced




Signed-off-by: Corey Hardesty <corey.hardesty@icloud.com>
Change-Id: I358a42b8da06b334030908c18842aef60fa3c5c2

show more ...


# 71e538fc 21-Mar-2022 Andrew Geissler <geissonator@yahoo.com>

ensure bmc-state-manager stays in quiesce state

Unsubscribing from systemd signals only prevents signals if no other
service within OpenBMC is subscribed. This is never going to be the case
in OpenB

ensure bmc-state-manager stays in quiesce state

Unsubscribing from systemd signals only prevents signals if no other
service within OpenBMC is subscribed. This is never going to be the case
in OpenBMC so along with unsubscribing, also reset the object
responsible for the callbacks within bmc-state-manager.

This is to ensure that once bmc-state-manager enters Quiesced, it never
exits from it. Have seen on a few systems that the multi-user.target
generates some events during different boot tests, causing
bmc-state-manager to reset the state to Ready.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ibe30cd631df7ac5f34e7bcb3640be27348034074

show more ...


# 37d36315 09-Mar-2022 Andrew Geissler <geissonator@yahoo.com>

change error trace to info in unit state check

The getUnitState() function was made more generic recently to handle
looking at other units. In some cases, a unit like the
obmc-bmc-service-quiesce@.t

change error trace to info in unit state check

The getUnitState() function was made more generic recently to handle
looking at other units. In some cases, a unit like the
obmc-bmc-service-quiesce@.target will not be loaded so systemd will not
be able to return any information to the GetUnit call.

This should not be treated like an error so change the log to an info
one. Callers of the function properly handle the empty string return.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Iadbb95acc1bce2b383f1339c9bf641c12c93787b

show more ...


# 2e352a21 02-Mar-2022 Andrew Geissler <geissonator@yahoo.com>

correct logic on detecting a pinhole reset

Per our circuit designer, a 0 actually is what indicates a pinhole
reset. My testing was in simulation so I was able to falsely test
my thinking of how the

correct logic on detecting a pinhole reset

Per our circuit designer, a 0 actually is what indicates a pinhole
reset. My testing was in simulation so I was able to falsely test
my thinking of how the hardware behaved.

There is also still an ongoing discussion on why some machines show the
inverse of this logic but the circuit designer assures me that a 1 is
the default and indicates the reboot was not a pinhole reset and a 0
indicates it was a pinhole reset.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I24e536e2dcb8b3263f4fa407bc6f91fdef3ae0ad

show more ...


# 9eb0e444 18-Feb-2022 Andrew Geissler <geissonator@yahoo.com>

crit-service: check for bmc quiesce on startup

If the new bmc-bmc-service-quiesce target is entered, then change the
BMC state to Quiesced and do not allow it to change until the BMC is
rebooted out

crit-service: check for bmc quiesce on startup

If the new bmc-bmc-service-quiesce target is entered, then change the
BMC state to Quiesced and do not allow it to change until the BMC is
rebooted out of the failure.

Tested:
- Installed new code on system and started target-monitor with new
critical services json file as input. Verified that when a critical
service was killed three times within quick succession, the service
went into a failed state, the target-monitor detected it, and BMC went
to Quiesced state.
- Restarted bmc-state manager application while BMC was in Quiesced
state and verified it rediscovered that upon restart.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I1096a29e4c244c0d0dfc9829f58fda6e1b2cba35

show more ...


# 2774c788 17-Feb-2022 Andrew Geissler <geissonator@yahoo.com>

crit-service: refactor unit state checking

Break this out into generic function so it can be utilized to also look
at the new new quiesce target in a future commit

Signed-off-by: Andrew Geissler <g

crit-service: refactor unit state checking

Break this out into generic function so it can be utilized to also look
at the new new quiesce target in a future commit

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I1277606d10c1d8e0eafc120ad1fd6cdf80013abd

show more ...


# a2a7e122 26-Jan-2022 Andrew Geissler <geissonator@yahoo.com>

pinhole: generate log when pinhole reset occurs

A pinhole reset is an important event for system admins and service
personnel to be aware of. Create a log to record this event.

Signed-off-by: Andre

pinhole: generate log when pinhole reset occurs

A pinhole reset is an important event for system admins and service
personnel to be aware of. Create a log to record this event.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ied4036e71655c61761e1a0cc46c881116a45685e

show more ...


# 98e64e6d 25-Jan-2022 Andrew Geissler <geissonator@yahoo.com>

pinhole: check for bmc reset reason

If firmware can not determine the reason for the BMC reset via the sysfs
bootstatus value then look for the pinhole rest GPIO to see if that is
the reason for the

pinhole: check for bmc reset reason

If firmware can not determine the reason for the BMC reset via the sysfs
bootstatus value then look for the pinhole rest GPIO to see if that is
the reason for the reboot.

See the following for more details:
https://github.com/openbmc/docs/blob/master/designs/power-recovery.md

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: If8e6e8cdc54dcb5f596d530c03c4676117fc8a47

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: I3878ec950b6a2b1ada93544cc02

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 ...


# 429100a8 09-Sep-2021 Andrew Geissler <geissonator@yahoo.com>

lg2: convert bmc state manager

This is an initial commit to begin moving phosphor-state-manager over to
the new phosphor-logging lg2 interfaces

Do a small commit initially to get any feedback befor

lg2: convert bmc state manager

This is an initial commit to begin moving phosphor-state-manager over to
the new phosphor-logging lg2 interfaces

Do a small commit initially to get any feedback before converting the
rest

Note that lg2 required c++20 which drove a few other minor changes in
this commit as well.

clang-tidy needs to be disabled until we get a version of clang that has
the following fixed:
https://reviews.llvm.org/D99181
Currently it is only in -13 release candidates.

Tested:
- Booted up in QEMU and verified lg2 entries were in journal

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I365965f19a64bd5fd05935d08c8aa487faf015c1

show more ...


# 2bfb1efc 16-Mar-2021 Tim Lee <timlee660101@gmail.com>

bmc-state-manager: Add support BMC Reboot Cause feature

Below is patch supporting this change.
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/41359

Tested:
busctl get-prope

bmc-state-manager: Add support BMC Reboot Cause feature

Below is patch supporting this change.
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/41359

Tested:
busctl get-property xyz.openbmc_project.State.BMC /xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC LastRebootCause

When unplug/plug in BMC power cable then return as below:
s "xyz.openbmc_project.State.BMC.BMCResetCause.POR"

When executing reboot command then return as below:
s "xyz.openbmc_project.State.BMC.BMCResetCause.Watchdog"

Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: I4e12f1df96cc1321beee0c4eae648d71e2d4a3b9

show more ...


12