History log of /openbmc/phosphor-fan-presence/power_state.hpp (Results 1 – 9 of 9)
Revision Date Author Comments
# dfddd648 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: Ica590f8613f1fb89ab1ca676ac51c1cc7e38d67f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 0cff4ea6 12-Sep-2023 Chau Ly <chaul@amperecomputing.com>

Small change to power state initial sequence

When HostPowerState is constructed with a callback, if it reads true
from HostState (different from the init value of _powerState), the
callback will be

Small change to power state initial sequence

When HostPowerState is constructed with a callback, if it reads true
from HostState (different from the init value of _powerState), the
callback will be called. This is not a power state change at all, so we
shouldn't call the callback.

Tested with monitor-use-host-state enabled for phosphor-fan-monitor
service.

When HostState is On, restart phosphor-fan-monitor service.
Result: the service won't throw or turn host off.

Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: Ie616a9631a129401a3cdc000612a8e694d02ef7a

show more ...


# fbf4703f 17-Jul-2023 Patrick Williams <patrick@stwcx.xyz>

use std::format instead of fmt::format

The std::format is sufficient for the uses in this repository except
for in one file (override_fan_target.cpp, since P2286 isn't supported
by GCC yet). Switch

use std::format instead of fmt::format

The std::format is sufficient for the uses in this repository except
for in one file (override_fan_target.cpp, since P2286 isn't supported
by GCC yet). Switch to std::format whenever possible.

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

show more ...


# 61b73296 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: I152f141a5e8343b92b5ce81d3ca16eec77b5606b
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 ...


# 2dd87bd1 24-Nov-2021 Kumar Thangavel <thangavel.k@hcl.com>

Add power_state implementation

Added power_state implementation for multi host platform
specific shutdown interfaces like hard shutdown or soft
shutdown interfaces.

Getting the current host state o

Add power_state implementation

Added power_state implementation for multi host platform
specific shutdown interfaces like hard shutdown or soft
shutdown interfaces.

Getting the current host state of all the hosts and set
power_state values based on the hosts current host state.

TESTED : Verified the Shutdown alarms trigged and platform
specific actions done in Facebook YosemiteV2 platform.

Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com>
Change-Id: I5e38bb9f28b7840c9de10082905b31deb8ffc4ff

show more ...


# bff172aa 17-Jun-2021 Matthew Barth <msbarth@us.ibm.com>

power_state: Catch DBusServiceError and wait

Update to catch the DBusServiceError exception for the service owning
the `org.openbmc.control.Power` interface with the `pgood` property not
being on db

power_state: Catch DBusServiceError and wait

Update to catch the DBusServiceError exception for the service owning
the `org.openbmc.control.Power` interface with the `pgood` property not
being on dbus yet and wait for a propertiesChanged signal for when the
service starts.

This is necessary for starting any of the fan applications using the
PGoodState object at multi-user.target in case they start prior to the
service noted above starting.

Change-Id: I2e07acc020ed21253c272c8d20346058b06e78bc
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>

show more ...


# 76e73c2a 21-Apr-2021 Matt Spinler <spinler@us.ibm.com>

Let PowerState class run multiple callbacks

Previously the PowerState class could only handle a single callback
function. This commit changes that to allow other callback functions to
be added with

Let PowerState class run multiple callbacks

Previously the PowerState class could only handle a single callback
function. This commit changes that to allow other callback functions to
be added with a addCallback() method. The callback functions are then
executed when the power state changes.

This also changes the use of the PowerState object in the fan presence
code to a shared_ptr instead of a unique_ptr, and adds a function to
return the PowerState object to use in the app, creating it if
necessary. This allows multiple pieces of the code to add their own
callbacks to the same object.

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

show more ...


# 432efecc 24-Sep-2020 Matt Spinler <spinler@us.ibm.com>

Add class to watch the the power state

Create a PowerState base class that has APIs to return the current power
state and to call a function on a power state change. This will be used
so that the f

Add class to watch the the power state

Create a PowerState base class that has APIs to return the current power
state and to call a function on a power state change. This will be used
so that the fan presence code can run even when power is off and know
not to bother creating event logs when a fan is missing with power off.

This is split into base and derived classes to make it easier for
different system architectures to look at different things. On
OpenPower systems, the 'pgood' property on the org.openbmc.Control.Power
interface will be used, and so a PGoodState child class was created to
watch that property.

If some other platform wants to look at something else, like the power
state property hosted by the chassis state object, then a new derived
class could be created and some code could be written to read the class
to create out of the JSON or the configuration options.

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

show more ...