Revision Date Author Comments
# 4fa67aa1 03-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: If152304b21dd2daaa2f79255a4f98218615efb05
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: If152304b21dd2daaa2f79255a4f98218615efb05
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# cb356d48 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: I9029cc722e7712633c15436bd3868d8c3209f567

show more ...


# 683a96c6 27-Apr-2022 Mike Capps <mikepcapps@gmail.com>

monitor: Capture BMC dumps on fan/ambient shutdowns

When fan-monitor or sensor-monitor generates an EPOW, this change
creates a BMC dump after the system is powered off and all error logs
are create

monitor: Capture BMC dumps on fan/ambient shutdowns

When fan-monitor or sensor-monitor generates an EPOW, this change
creates a BMC dump after the system is powered off and all error logs
are created.

Change-Id: Iacdd2d2b388e79988e2536d52497f0e697e1d444
Signed-off-by: Mike Capps <mikepcapps@gmail.com>

show more ...


# 7f6946b2 14-May-2021 Matt Spinler <spinler@us.ibm.com>

sensor:monitor: Use a single PowerState object

Now that both monitor classes need to know about power state, change
them to keep a shared_ptr to a PowerState object and then pass the
object into the

sensor:monitor: Use a single PowerState object

Now that both monitor classes need to know about power state, change
them to keep a shared_ptr to a PowerState object and then pass the
object into their constructors.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ia83217e8af51204bbb3fc6e8e3f2eac5912b5913

show more ...


# 2a6b39c8 11-May-2021 Matt Spinler <spinler@us.ibm.com>

sensor-monitor: Changes for power off error

The hard and soft shutdown alarm errors are posted twice when a system
shuts down due to those thresholds being exceeded, once when the
threshold is first

sensor-monitor: Changes for power off error

The hard and soft shutdown alarm errors are posted twice when a system
shuts down due to those thresholds being exceeded, once when the
threshold is first exceeded, and again when the shutdown actually
occurs. For these errors, make the following changes that will
differentiate them from the first time they were logged:

1. Change severity to Critical
2. Set POWER_THERMAL_CRITICAL_FAULT=TRUE in the additional data
3. Set SEVERITY_DETAIL=SYSTEM_TERM in the additional data

Certain implementations, such as the IBM one, will take additional
actions based on these changes.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I94a1cc9dad492e78f59619c4012bcaf6a4c81431

show more ...


# ffd54674 21-Jan-2021 Matt Spinler <spinler@us.ibm.com>

sensor-mon: Create event logs

Create phosphor-logging event logs when the alarms are tripped and
cleared. The severity will be 'Error' on trip, and 'Informational'
on clear.

The error names will b

sensor-mon: Create event logs

Create phosphor-logging event logs when the alarms are tripped and
cleared. The severity will be 'Error' on trip, and 'Informational'
on clear.

The error names will be xyz.openbmc_project.Sensor.Threshold.Error.
HardShutdownAlarmLow
HardShutdownAlarmLowClear
HardShutdownAlarmHigh
HardShutdownAlarmHighClear

When the shutdown occurs after the delay, the AlarmLow/AlarmHigh events
are sent again. This is so there is an event log that occurs at the
time of the shutdown, and it says what the problem was that caused it.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If36c48e73f4208d781040c8b2c06995f66bebc20

show more ...


# 08a66efa 21-Jan-2021 Matt Spinler <spinler@us.ibm.com>

sensor-mon: Persist timer start times

It's possible that while a shutdown timer is running, this app or the
whole BMC may restart. In that case, we want to restart the timer with
only the remaining

sensor-mon: Persist timer start times

It's possible that while a shutdown timer is running, this app or the
whole BMC may restart. In that case, we want to restart the timer with
only the remaining time, assuming the alarm is still active.

To do this, create a new AlarmTimestamps class to hold any running timer
start times and persist these times using the cereal library. If the
application is restarted with timestamps written out and the alarm is
initially active and power is on, then the shutdown timer will be
calculated to be:
delay = shutdownDelay - (now - original time)

Note that cereal doesn't know how to handle the AlarmType or
ShutdownType types so they are converted to ints before writing.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If07abe91c0e6951fcd74bbc49eb511a38f7b4006

show more ...


# 0b839516 21-Jan-2021 Matt Spinler <spinler@us.ibm.com>

sensor-mon: Start timers and shutdown

When the threshold alarm is tripped, start a timer for the configured
amount of time. If the alarm clears before that time, stop the timer.
If it doesn't, powe

sensor-mon: Start timers and shutdown

When the threshold alarm is tripped, start a timer for the configured
amount of time. If the alarm clears before that time, stop the timer.
If it doesn't, power off the system.

Note that the alarm for the SoftShutdown threshold still does a hard
shutdown. That's because in the family of systems this was written for,
the hypervisor also gets an alert when the threshold trips and is the
one that drives the power off. The shutdown that this code does would
only occur when the hypervisor doesn't shut down first.

This could easily be wrapped in some sort of compile flags where the
default behavior would be to do a soft shutdown, but since at this point
there is no user of that the default will remain the way it is.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I3bc8f82562594dcd61bfcbc471ffe1a2d9451595

show more ...


# 16c7dc1e 21-Jan-2021 Matt Spinler <spinler@us.ibm.com>

sensor-mon: Handle propertiesChanged

Fill in the handler for a Threshold.HardShutdown or
Threshold.SoftShutdown property changing.

If the power is off, do nothing, otherwise read out the changed al

sensor-mon: Handle propertiesChanged

Fill in the handler for a Threshold.HardShutdown or
Threshold.SoftShutdown property changing.

If the power is off, do nothing, otherwise read out the changed alarm
properties and check if any action needs to be taken.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I379e90dffe3e6d3acdf18820bda34f2a5671f57a

show more ...


# 9c0715b6 21-Jan-2021 Matt Spinler <spinler@us.ibm.com>

sensor-mon: Create sensor-monitor application

This is a new application that will be used to take actions based on
sensor values or sensor threshold alarm values. It's not built unless
the --enable

sensor-mon: Create sensor-monitor application

This is a new application that will be used to take actions based on
sensor values or sensor threshold alarm values. It's not built unless
the --enable-sensor-monitor option is used.

The first behavior will be to do power offs and create event logs based
on the xyz.openbmc_project.Sensor.Threshold.HardShutdown and
SoftShutdown threshold interfaces that may be present on sensor object
paths. It will watch the high and low alarm properties on those
interfaces. This could then be used to power off the system after some
delay if some sensor value gets too high or low, such as a high ambient
or a low voltage.

This first commit in the series creates the application and a new
ShutdownAlarmMonitor class, which is where the monitoring will happen.
Initially, it just finds all existing soft and hard shutdown interfaces
on D-Bus and puts them in a map. It also registers for properties
changed signals for those interfaces.

Note that the interfacesAdded signal doesn't need to be used because all
sensor applications today emit propertiesChanged signals when they first
start up anyway.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ia5b82fcbe32f65d94b23bf26a025202a7f885183

show more ...