History log of /openbmc/phosphor-hwmon/mainloop.hpp (Results 1 – 25 of 39)
Revision Date Author Comments
# 94539af6 01-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: Ie32798cbf7083f3e59a4f36ff9459bb737c97476
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: Ie32798cbf7083f3e59a4f36ff9459bb737c97476
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 47fb49ac 19-Oct-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

sensor: Implement sensor "PRIORITY"

This commit introduces the `xyz.openbmc_project.Common.Priority`
interface to define the priority of sensors. If a sensor's priority
attribute is specified, this

sensor: Implement sensor "PRIORITY"

This commit introduces the `xyz.openbmc_project.Common.Priority`
interface to define the priority of sensors. If a sensor's priority
attribute is specified, this interface is created with the 'priority'
attribute. However, if the priority attribute is not specified, this
interface is not created.

The `xyz.openbmc_project.Common.Priority` interface is used to indicate
the priority level of fan sensors. It provides information about
primary and secondary RPM sensors for dual rotor fans, allowing for a
more specific description of the sensor's priority.

phosphor-dbus-interfaces commit:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/66779

Tested: Build phosphor-hwmon successfully

'''
1. Retrieve the priority level of the secondary sensor

busctl introspect xyz.openbmc_project.Hwmon-xxx .Hwmon1 \
/xyz/openbmc_project/sensors/fan_tach/fan1_1 xyz.openbmc_project.Common.Priority

NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.Priority property u 1 emits-change writable

2. If the "PRIORITY" is not specified in the sensor's configuration file

busctl introspect xyz.openbmc_project.Hwmon-xxx .Hwmon1 \
/xyz/openbmc_project/sensors/fan_tach/fan1_0 xyz.openbmc_project.Common.Priority
NAME TYPE SIGNATURE RESULT/VALUE FLAGS

3. Change the sensor priority

busctl set-property xyz.openbmc_project.Hwmon-xxx.Hwmon1 \
/xyz/openbmc_project/sensors/fan_tach/fan1_1 xyz.openbmc_project.Common.Priority \
Priority u 0

busctl introspect xyz.openbmc_project.Hwmon-xxx .Hwmon1 \
/xyz/openbmc_project/sensors/fan_tach/fan1_1 xyz.openbmc_project.Common.Priority
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.Priority property u 0 emits-change writable
'''

Change-Id: I7a226cf105756bc32e04f6724428d93e84dfb72a
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>

show more ...


# e8771fd4 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: I267a17e007b99caed10aef060e7dd9a0bcc5fc2e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# c9d61613 12-Oct-2022 George Liu <liuxiwei@inspur.com>

sensor: Implement sensor "ACCURACY"

Support the accuracy attribute of the sensor. Since the latest
Redfish spec needs to support the accuracy attribute of the sensor,
extend the configuration file s

sensor: Implement sensor "ACCURACY"

Support the accuracy attribute of the sensor. Since the latest
Redfish spec needs to support the accuracy attribute of the sensor,
extend the configuration file syntax to support the accuracy value,
read the value and publish it to the new D-Bus Accuracy interface.

Also, This function will be synchronized to the dbus sensors repo in
the future.

Tested: Build phosphor-hwmon successfully
eg: The configuration accuracy in power supply is 1
~# busctl get-property xyz.openbmc_project.Hwmon-xxx.Hwmon1
/xyz/openbmc_project/sensors/power/ps0_input_power
xyz.openbmc_project.Sensor.Accuracy Accuracy
d 1

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Idd0159b75a7506001cf886f4ae8a22dbd38b1135

show more ...


# ad6043f6 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: I86dfa77a53a306b0e868eeb82de30b270704c455

show more ...


# 6d50c3e9 09-Aug-2019 Brandon Kim <brandonkim@google.com>

sensor: Implement sensor "ASYNC_READ_TIMEOUT"

This change will prevent sensors from blocking all other sensor reads
and D-Bus if they do not report failures quickly enough.

If "ASYNC_READ_TIMEOUT"

sensor: Implement sensor "ASYNC_READ_TIMEOUT"

This change will prevent sensors from blocking all other sensor reads
and D-Bus if they do not report failures quickly enough.

If "ASYNC_READ_TIMEOUT" environment variable is defined in the
sensor's config file for a key_type, the sensor read will be
asynchronous with timeout set in milliseconds.

For example for "sensor1":
ASYNC_READ_TIMEOUT_sensor1="1000" // Timeout will be set to 1 sec

If the read times out, the sensor read will be skipped and the
sensor's functional property will be set to 'false'. Timed out futures
will be placed in a map to prevent their destructor from running and
blocking until the read completes (limitation of std::async).

Tested: This patch has been running downstream for over a year to
solve a slow I2C sensor reads causing IPMI slowdown.

Change-Id: I3d9ed4d5c9cc87d3196fc281451834f3001d0b48
Signed-off-by: Brandon Kim <brandonkim@google.com>

show more ...


# d46d0818 03-Feb-2021 Anton D. Kachalov <gmouse@google.com>

Add sensor instance id command line argument.

Introduce `-i|--sensor-id` flag to explicitly set sensor
suffix for dbus name.

Sample usage:

phosphor-hwmon-readd -i test_sensor_id -o /apb/...

Wi

Add sensor instance id command line argument.

Introduce `-i|--sensor-id` flag to explicitly set sensor
suffix for dbus name.

Sample usage:

phosphor-hwmon-readd -i test_sensor_id -o /apb/...

Will register the service with the following busname:

xyz.openbmc_project.Hwmon-test_sensor_id.Hwmon1

This change required as a part of privilege separation work:
https://github.com/openbmc/openbmc/issues/3383

Signed-off-by: Anton D. Kachalov <gmouse@google.com>
Change-Id: I48ff9c3efe0edb84718ff8f695e7e932af5445de

show more ...


# ecac0ae2 08-Jul-2020 Matt Spinler <spinler@us.ibm.com>

Fixes for when sensor value is a double

The change to the xyz.openbmc_project.Sensor.Value interface that moves
the Value property to a double from an int64_t has merged, which
uncovered some proble

Fixes for when sensor value is a double

The change to the xyz.openbmc_project.Sensor.Value interface that moves
the Value property to a double from an int64_t has merged, which
uncovered some problems in the code that was trying to detect the type
and handle it accordingly.

This does remove support for the Scale property on the Value interface,
as meson CI won't even compile with it since the double version of it is
empty and so the function has unused parameters, which meson doesn't
like.

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

show more ...


# 9bbe6026 01-Aug-2019 Carol Wang <wangkair@cn.ibm.com>

Support averaging power values

Support new env variables 'AVERAGE_power* = "true"' in hwmon config file.
When this env variable is set, power value is the calculated average value.
Otherwise, power

Support averaging power values

Support new env variables 'AVERAGE_power* = "true"' in hwmon config file.
When this env variable is set, power value is the calculated average value.
Otherwise, power value is from power*_input by default.
The new average of power is calculated since the last time the sensor's
values were changed and read.

average =
(cur_average*cur_average_interval - pre_average*pre_average_interval) /
(cur_average_interval - pre_average_interval)

hwmon config example:
AVERAGE_power2 = "true"
AVERAGE_power3 = "true"
AVERAGE_power4 = "true"

Tested: Set AVERAGE_power* in p0 OCC hwmon conf but not in p1 OCC hwmon conf,
then get power sensor info with restapi to check the values.
1. The values of p0*power are all average values.
2. The values of p1*power are all input values.

Note:
Delete $(CODE_COVERAGE_CPPFLAGS) in AM_CPPFLAGS in test/Makefile.am.
This option will define NDEBUG during configuration, then assert in
code doesn't work.

Resolves: openbmc/openbmc#3187
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>
Change-Id: I8d97a7b2905c79cd4f2c276b32e7f5590ffc0483

show more ...


# feb744a7 26-Jun-2019 Patrick Venture <venture@google.com>

mainloop: move out the interface update method

Move the interface update method out of the read() loop.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I430d20ded4efd89c691eff368d005

mainloop: move out the interface update method

Move the interface update method out of the read() loop.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I430d20ded4efd89c691eff368d005791f0138929

show more ...


# 16805a6a 21-Jun-2019 Patrick Venture <venture@google.com>

mainloop: Make HwmonIO injectable dependency

HwmonIO was make into a interface object implementation. This patch
transitions mainloop to receive a pointer to this interface to allow for
injection t

mainloop: Make HwmonIO injectable dependency

HwmonIO was make into a interface object implementation. This patch
transitions mainloop to receive a pointer to this interface to allow for
injection testing.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Iaa470fafccb42c4d7fbabac0dc92f96c8075faf2

show more ...


# 0cd4f69f 21-Jun-2019 Patrick Venture <venture@google.com>

mainloop: add helper methods for sensor removal

Add a helper method that will remove from dbus sensors that are marked
for removal and another helper method that will attempt to add sensors
marked f

mainloop: add helper methods for sensor removal

Add a helper method that will remove from dbus sensors that are marked
for removal and another helper method that will attempt to add sensors
marked for removal back.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Iecb96045cc63d93f2896af9f6a8c2672ca8fcbb2

show more ...


# 52b40613 19-Dec-2018 Patrick Venture <venture@google.com>

mainloop: add underscore prefix to members

Most members of mainloop object have an underscore prefix. For
consistency add this prefix to all members. The discussion within
OpenBMC pertaining to pr

mainloop: add underscore prefix to members

Most members of mainloop object have an underscore prefix. For
consistency add this prefix to all members. The discussion within
OpenBMC pertaining to prefixes and suffixes for member variables
indicates there is latitude within a repository.

Change-Id: Ifce915923b9b8c58a433f334d45e19143b7b734f
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 0dd0c4d7 18-Oct-2018 William A. Kennington III <wak@google.com>

timer: Remove in favor of sdeventplus/timer

Lets use the new standard event loop timer utility that comes with
sdeventplus instead of the one copied from other projects.

Change-Id: Ie7c8f462f2c0e2e

timer: Remove in favor of sdeventplus/timer

Lets use the new standard event loop timer utility that comes with
sdeventplus instead of the one copied from other projects.

Change-Id: Ie7c8f462f2c0e2e05ce14da58b30a1f91acbf75d
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...


# 0fe4cb34 18-Oct-2018 William A. Kennington III <wak@google.com>

mainloop: Use sdeventplus

Convert to using sdeventplus instead of sd_event directly.

Change-Id: Ie8ee25c2d75ac4c56b88fb79f70eaa53c4f7b6e4
Signed-off-by: William A. Kennington III <wak@google.com>


# 4cbdfef2 18-Oct-2018 William A. Kennington III <wak@google.com>

Remove old experimental includes

We are now using c++17 so we no longer need experimental optional and
any. We can use the standard any and optional now.

Change-Id: I88fcb4258c69ac5ad9766e2c65463c5

Remove old experimental includes

We are now using c++17 so we no longer need experimental optional and
any. We can use the standard any and optional now.

Change-Id: I88fcb4258c69ac5ad9766e2c65463c52a3b7f05f
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...


# 043d3230 31-Aug-2018 Patrick Venture <venture@google.com>

add .clang-format

Change-Id: I94ce26d595367e08d6fb3734535bcd855f1b1473
Signed-off-by: Patrick Venture <venture@google.com>


# 9c43106c 07-May-2018 Matthew Barth <msbarth@us.ibm.com>

Add sensor object framework

Create a sensor object to store sensor monitoring specifications.

Tested:
Sensor objects are created and stored for each sensor

Change-Id: Idfa982f1bb8da888abbd4738

Add sensor object framework

Create a sensor object to store sensor monitoring specifications.

Tested:
Sensor objects are created and stored for each sensor

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

show more ...


# c897d8bb 23-Apr-2018 Patrick Venture <venture@google.com>

mainloop: add uniqueness to busname

There can be multiple daemon instances that have the
same devpath which leads to a collision which errors silently.
This adds uniqueness to the path, which was no

mainloop: add uniqueness to busname

There can be multiple daemon instances that have the
same devpath which leads to a collision which errors silently.
This adds uniqueness to the path, which was no longer human-readable
to avoid this collision situation.

Tested: Ran on quanta-q71l with unique devices and two instances
pointing to the same device and it correctly set them up with unique
but deterministic bus names.
Change-Id: Id5aea3c3df5f793b28557a74995608ec40792a43
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 0b305058 26-Apr-2018 Matthew Barth <msbarth@us.ibm.com>

Remove OCC EREMOTEIO return code hack

With openbmc/openbmc#2329, an OCC sensor value will not be read when the
associated fault file is set to true. This will set the value to 0 when
a sensor is fau

Remove OCC EREMOTEIO return code hack

With openbmc/openbmc#2329, an OCC sensor value will not be read when the
associated fault file is set to true. This will set the value to 0 when
a sensor is faulted at startup or not update the previous value during
the monitoring loop if the OCC sensor becomes faulted.

Applications(i.e. fan control) needing to react to a faulted OCC sensor
can subscribe to property changed signals on the OperationalStatus
Functional property for the sensor's dbus object.

Tested:
A faulted OCC sensor has a non-functional status on dbus

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

show more ...


# d238e232 17-Apr-2018 Matthew Barth <msbarth@us.ibm.com>

Return sensor object state data as optional

Previously, the getObject function moved the sensor data passed in as a
constant reference, which should not have been done. The intention of
the getObjec

Return sensor object state data as optional

Previously, the getObject function moved the sensor data passed in as a
constant reference, which should not have been done. The intention of
the getObject function is to retrieve the sensor's object state data.
Then, the necessary sensor data and the created object state data can be
appropriately handled for monitoring.

This change is to remove this confusion and clearly create the sensor's
object state data without modifying the sensor set data passed in to
getObject.

Tested:
Sensor objects are still created correctly
Sensor states are monitoring and updated as before

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

show more ...


# 75e56c67 20-Apr-2018 Patrick Venture <venture@google.com>

hwmonio: split IoAccess object out

Split out the hwmon io access object from the sysfs namespace
into its own.

Change-Id: I8d1a45630117d1d503d0d5fa6061163911b695e8
Signed-off-by: Patrick Venture <v

hwmonio: split IoAccess object out

Split out the hwmon io access object from the sysfs namespace
into its own.

Change-Id: I8d1a45630117d1d503d0d5fa6061163911b695e8
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 979c806d 17-Apr-2018 Matthew Barth <msbarth@us.ibm.com>

Get sensor identifiers function

To minimize handling the return cases when getting a sensor object,
retrieve the sensor identifiers from a function. The identifiers
returned are then checked to be v

Get sensor identifiers function

To minimize handling the return cases when getting a sensor object,
retrieve the sensor identifiers from a function. The identifiers
returned are then checked to be valid before proceeding in creating the
sensor object.

Tested:
Sensor objects created the same
Empty id or label cause sensor object to not be created

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

show more ...


# d4beecfa 03-Apr-2018 Matthew Barth <msbarth@us.ibm.com>

No retries when adding a purposely removed sensor

When a sensor is removed due to a removal return code being received
during a read, no read retries should be done when attempting to re-add
it. Thi

No retries when adding a purposely removed sensor

When a sensor is removed due to a removal return code being received
during a read, no read retries should be done when attempting to re-add
it. This requires the sensor to be successful in its first read
attempted when being re-added and keeps the re-adding of purposely
removed sensors from consuming up to 1 second during the re-add attempt.

Tested:
A removed sensor is attempted to be read once on re-add

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

show more ...


# 31d214cc 26-Mar-2018 Matthew Barth <msbarth@us.ibm.com>

Attempt adding sensors with initial read error rc

Sensors that initially returned a read error return code defined to not
have the sensor added to dbus should be attempted to be added after the
moni

Attempt adding sensors with initial read error rc

Sensors that initially returned a read error return code defined to not
have the sensor added to dbus should be attempted to be added after the
monitoring loop for all device sensors has ended. When a sensor object
that was not created due to this is successfully added to dbus, the
sensor is removed from the removal list.

Tested:
Verify a sensor with a defined return code returned is not added
A sensor not initially created is added when successfully read

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

show more ...


12