History log of /openbmc/dbus-sensors/src/HwmonTempSensor.cpp (Results 1 – 25 of 54)
Revision Date Author Comments
# eacbfdd1 04-Apr-2024 Ed Tanous <ed@tanous.net>

Enable misc-include-cleaner

Change-Id: I22099a0f95b2eb884dec7d95cee0bdd0c159fd1f
Signed-off-by: Ed Tanous <ed@tanous.net>


# 201a1015 03-Apr-2024 Ed Tanous <ed@tanous.net>

Add modernize-redundant-void-arg

Enable this check and fix the failures.

Change-Id: I89b13daf1161be40564367562bb9c8c0c459e1d0
Signed-off-by: Ed Tanous <ed@tanous.net>


# 597e8423 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 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-17 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: I73acd9daf41b52bcc3f6af9a1c38c5f162ae76b2
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 779c96a2 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: I0d10afa582342818b9d90b168f6f39f71ce4e0f4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
[AJ: regenerate using .clang-format from openbmc/docs@f44abd66eca8]
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 83db50ca 01-Mar-2023 Ed Tanous <edtanous@google.com>

Don't use deprecated asio functions

This code used a number of asio functions that have been deprecated.
This patch replaces them with their new equivalents, and enabled
BOOST_ASIO_NO_DEPRECATED.

C

Don't use deprecated asio functions

This code used a number of asio functions that have been deprecated.
This patch replaces them with their new equivalents, and enabled
BOOST_ASIO_NO_DEPRECATED.

Change-Id: I98bddba4c7d72a53ceca9455429828e60f06c5e0
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# 1f978631 28-Feb-2023 Ed Tanous <edtanous@google.com>

Change io_service to io_context

This was renamed a while back in boost to be compliant with the
std::executors proposal.

Change-Id: Ib56544a0a7478990d18fe9e0bbbd8db1e52fa5b8
Signed-off-by: Ed Tanou

Change io_service to io_context

This was renamed a while back in boost to be compliant with the
std::executors proposal.

Change-Id: Ib56544a0a7478990d18fe9e0bbbd8db1e52fa5b8
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# e73bd0a1 24-Jan-2023 Andrew Jeffery <andrew@aj.id.au>

sensors: Align source structure away from anti-patterns

The anti-patterns document comments on source structure, specifically
on placing internal headers in a parallel subtree[1]. dbus-sensors is an

sensors: Align source structure away from anti-patterns

The anti-patterns document comments on source structure, specifically
on placing internal headers in a parallel subtree[1]. dbus-sensors is an
example of violating this anti-pattern, so fix it.

[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#placing-internal-headers-in-a-parallel-subtree

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I50ecaddd53fa9c9b7a0441af9de5e60bd94e47c6

show more ...


# a1456c4a 18-Jul-2022 Zev Weiss <zev@bewilderbeest.net>

hwmontempsensor: Manage devices on host power-state events

We now install handler callbacks for power event signals, deactivating
sensors on power-off and activating them on power-on/POST-complete
a

hwmontempsensor: Manage devices on host power-state events

We now install handler callbacks for power event signals, deactivating
sensors on power-off and activating them on power-on/POST-complete
according to their PowerState configuration. This is needed to properly
support sensor devices that are in the same power domain as the host,
and hence may need their drivers bound only after the host is powered on
so that the driver can properly probe and attach to the device (and
likewise be unbound when the host is powered off).

Tested: in combination with corresponding entity-manager patches to
prevent it from trying to manage the same devices, hwmontempsensor
successfully activates and deactivates host-power-domain nct6779 and
w83773g sensors on romed8hm3. After the host is shut off, sensors
remain on dbus with 'Available' set to false and 'Value' reading NaN.
Also tested killing hwmontempsor after it instantiated host-power-domain
sensors, shutting off the host, and then restarting hwmontempsensor to
verify that it removed and re-created the sensor devices as necessary.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I2e272fd0870f3abfb06b6f3617f32721861bbc5b

show more ...


# 9b4a20e9 06-Sep-2022 Ed Tanous <edtanous@google.com>

Move to steady_timer

deadline_timer and steady_timer have one important difference, the
former runs off CLOCK_REALTIME, and the later runs off CLOCK_MONOTONIC.
For a long time we've relied on deadli

Move to steady_timer

deadline_timer and steady_timer have one important difference, the
former runs off CLOCK_REALTIME, and the later runs off CLOCK_MONOTONIC.
For a long time we've relied on deadline_timer incorrectly, given that
dbus-sensors does not care in the least about the calendar time, and
only cares about the difference between sensor scans.

Fortunately, this likely has no effect on the behavior of the sensors
most of the time, and in general, in a time change, the clock generally
moves forward, so all timers would immediately expire, scan all sensors,
and move on. phosphor-pid-control is intentionally designed to handle
this case, so it's quite likely that a user would never notice it, and
even if they did, would have to be looking at a debug console the moment
it happened.

The other effect is that in most cases, sensors call clock_gettime more
than they probably need to, which might slow down the performance.

This commit moves all usages of sensor timing to steady_timer, which
should give us more consistent results, and (in theory at least) be
faster. Because of stdlib compliance things, this also has the effect
of us dropping our dependence on boost::posix_time, and move to
std::chrono::duration objects, per the coding standard.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I69f948fb3f0fc0dfd7fd196d26ba46742a3e15a7

show more ...


# 6c106d66 17-Aug-2022 Zev Weiss <zev@bewilderbeest.net>

Replace boost string predicate functions with stdlib ones

Now that we're on C++20 we no longer need boost for starts_with() and
ends_with() tests.

Also remove the predicate.hpp #include from files

Replace boost string predicate functions with stdlib ones

Now that we're on C++20 we no longer need boost for starts_with() and
ends_with() tests.

Also remove the predicate.hpp #include from files that weren't actually
using anything from it.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: Id68a019d5108a4646eb9b5fd18af33d60617e048

show more ...


# d1c8f443 29-Jul-2022 Zev Weiss <zev@bewilderbeest.net>

hwmontempsensor: Simplify I/O and buffering

We can avoid the complexity and additional allocations of
boost::asio::streambuf by just using a simple fixed-size inline array as
the HwmonTempSensor rea

hwmontempsensor: Simplify I/O and buffering

We can avoid the complexity and additional allocations of
boost::asio::streambuf by just using a simple fixed-size inline array as
the HwmonTempSensor read buffer.

While the underlying cause of the issue remains unknown at present, this
also seems to resolve a use-after-free bug that could occur with the
existing buffering scheme (https://github.com/openbmc/dbus-sensors/issues/20).

Based on a WIP patch by @edtanous:
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/55041

Tested: on romed8hm3, hwmontempsensor provides appropriate readings on
dbus as it did prior to this patch. In combination with the debug
patches in https://github.com/openbmc/dbus-sensors/issues/20, an ASAN
build did not report any problems while repeatedly rebuilding sensors.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7f0ab63fc398b8c938592f38f137174187c5e438

show more ...


# 2049bd26 09-Jul-2022 Ed Tanous <edtanous@google.com>

Clang-tidy-14 fixes

Do as the robot commands. All changes made automatically by tidy.

Tested: (Thanks Zhikui)
Downloaded and run on system. Sensors scan normally.

Signed-off-by: Ed Tanous <edtan

Clang-tidy-14 fixes

Do as the robot commands. All changes made automatically by tidy.

Tested: (Thanks Zhikui)
Downloaded and run on system. Sensors scan normally.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I752f37c9e7a95aa3be8e6980ba6e4b2b48b3395a

show more ...


# bb67932a 16-May-2022 Ed Tanous <edtanous@google.com>

Apply LambdaBodyIndentation to dbus-sensors

Per the transform being done in bmcweb, do the same for dbus-sensors.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If21489607759f3cdf20fad17

Apply LambdaBodyIndentation to dbus-sensors

Per the transform being done in bmcweb, do the same for dbus-sensors.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If21489607759f3cdf20fad17eede50fb4e228e5e

show more ...


# 99c4409a 14-Jan-2022 Ed Tanous <edtanous@google.com>

Enable cppcoreguidelines-pro-type-vararg check

We only had one usage of printf in the code that was in violation of
this rule, so replace it with iostreams, and enable the check.

Signed-off-by: Ed

Enable cppcoreguidelines-pro-type-vararg check

We only had one usage of printf in the code that was in violation of
this rule, so replace it with iostreams, and enable the check.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie62165b599a996f34893aa5a3f8d1f6e6cbaf903

show more ...


# 3928741a 04-Feb-2022 Andrei Kartashev <a.kartashev@yadro.com>

sensors: don't pass excess conn handler

We don't need to pass connection handler to setInitialProperties method
since it already part of the sensor class.

Tested: no changes in behaviour.
Signed-of

sensors: don't pass excess conn handler

We don't need to pass connection handler to setInitialProperties method
since it already part of the sensor class.

Tested: no changes in behaviour.
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
Change-Id: Icaaccbeaf14e22648a6a1bce381f0f0a606b0ddd

show more ...


# 5667808a 04-Jan-2022 Jayashree Dhanapal <jayashree-d@hcl.com>

Move threshold interfaces to common function

Threshold Hardshutdown and Softshutdown interfaces needs to be
created for sensors. Therefore, created a common function
called getInterface() to access

Move threshold interfaces to common function

Threshold Hardshutdown and Softshutdown interfaces needs to be
created for sensors. Therefore, created a common function
called getInterface() to access all the threshold
interfaces from all the sensors source file and removed
hasCriticalInterface(), hasWarningInterface() functions.

Moreover, threshold interfaces from all the sensor constructor has
been refactored to avoid duplicating functions.

TESTED: Tested on Facebook YosemiteV2 hardware. Verified that the
Warning and Critical interfaces are created and displaying in
dbus objects.

Signed-off-by: Jayashree Dhanapal <jayashree-d@hcl.com>
Change-Id: I9c7d049c7d4445d7199bf63d8e729838990880e9

show more ...


# 544e7dc5 29-Jul-2021 Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>

DPS310 temperature pressure, SI7020 temperature

Infineon DPS310 pressure and temperature sensors for the Blyth
and Storm King Panel, as well as the Silicon Laboratories
SI7020 type s

DPS310 temperature pressure, SI7020 temperature

Infineon DPS310 pressure and temperature sensors for the Blyth
and Storm King Panel, as well as the Silicon Laboratories
SI7020 type sensors. This provide OpenBMC with the ability
to have the DPS310 pressure and temperature sensors also the
Silicon Laboratories SI7020 type sensors provide OpenBMC
with temperature sensor on dbus via dbus-sensors through
HwmonTempSensor. And adds "pressure" as a type of sensor.
Changed sensorScaleFactor to have offsetValue and scaleValue
for _raw IIO devices, scaleValue is a multiplier where
sensorScaleFactor was a divisor. Pulling this into HwmonTempSensor
came about from this Discord discussion:
https://discord.com/channels/775381525260664832/775381525260664836/869641817220595772

Tested: on Rainier's Blyth and Everest's Storm King Op Panels
busctl tree --no-pager xyz.openbmc_project.HwmonTempSensor
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/Ambient_0_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/Ambient_1_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/Ambient_2_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/PCIE_0_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/PCIE_1_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/pressure/Station_Pressure
Results consistent with location of the systems.

Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
Change-Id: I5c0d56b486a671ee507c7bfe18fea72e7eaf9ebe

show more ...


# da98f095 01-Nov-2021 Zhikui Ren <zhikui.ren@intel.com>

psusensor: fix psu pwm sensor name

Current bug is that psusensor service does not create pwm sensor object
if pid fan configuration has spaces in Name field, like
{
...
"Name

psusensor: fix psu pwm sensor name

Current bug is that psusensor service does not create pwm sensor object
if pid fan configuration has spaces in Name field, like
{
...
"Name" : "PSU$BUS $ADDRESS Fan 1"
"Outputs": [
"Pwm PSU$BUS $ADDRESS Fan 1"
],
...
}

Fix:
Pwm name need to be escaped, which currently replaces " " with "_"
before being passed to CreatePwmSensor in PSUSensor service.
PwmSensor constructor takes the name as is.

Since the escape algorithm may change in the future,
add a helper function escapeName() and update dbus-sensors
to use this helper funtion when sensors are created.
escapeName() currently calls boost replace_all_copy(name," ", "_"),
so it does not introduce functional changes except the bug identified
above.

Tested:
No regression found for existing working sensors.
Sensors are created as before with the same sensor name.

Fix for non-working case works correctly now.
psu pwm sensor name with space are created correctly with the change.
busctl tree xyz.openbmc_project.PSUSensor
...
|-/xyz/openbmc_project/control
| `-/xyz/openbmc_project/control/fanpwm
| |-/xyz/openbmc_project/control/fanpwm/Pwm_PSU17_2_Fan_1
| |-/xyz/openbmc_project/control/fanpwm/Pwm_PSU17_2_Fan_2
...

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: If3b60f93de324e59cc3d774285c23bf50a6f989c

show more ...


# 3291b9c7 29-Jul-2021 Jie Yang <jjy@google.com>

Sensor mutability interface

We proposed a ValueMutablity interface in
openbmc/phosphor-dbus-interfaces which was accepted here:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-

Sensor mutability interface

We proposed a ValueMutablity interface in
openbmc/phosphor-dbus-interfaces which was accepted here:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/36333

It follows the IPMI fashion, checking
the sensor mutability before writing sensor values. The sensor
mutability used to be hardcoded in the ipmi sensor map yaml file.

This provides feature parity with that old YAML hardcoded
"mutability: Mutability::Write|Mutability::Read" setting.

As an example of implementation within dbus-sensors, ExternalSensor
always sets Mutable to true, given its purpose of accepting sensor
writes from an external source. PwmSensor accepts the "Mutable"
parameter, from entity-manager configuration (aka JSON file). All
other sensors always set Mutable to false, but it would be
straightforward to add similar code, like what was done for
PwmSensor, when mutability is desired.

This parameter will be used by the IPMI server here:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/45407

There is currently no Redfish equivalent, although that would
be a welcome task for the future. This is not IPMI-specific,
as the Redfish server can also use this as a hint, as to whether
to allow read-write access, or merely to allow read-only access.

This is not to be confused with the "manufacturing mode" option, which
is designed for use during manufacturing test, hence its name. This
feature is designed for production, and is intended to allow just a
few sensors to be writable, without needing to make them all writable.

Tested:
DBus call on fan sensors with configurable tree mutability:
busctl introspect xyz.openbmc_project.FanSensor /xyz/openbmc_project/sensors/fan_pwm/fan0
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
...
xyz.openbmc_project.Sensor.Value interface - - -
.MaxValue property x 100 emits-change
.MinValue property x 0 emits-change
.Unit property s "xyz.openbmc_project.Sensor.Value.Uni... emits-change
.Value property d 42.7451 emits-change writable
xyz.openbmc_project.Sensor.ValueMutability interface - - -
.Mutable property b true emits-change
...

DBus call on external sensors:
busctl introspect xyz.openbmc_project.ExternalSensor /xyz/openbmc_project/sensors/tempera
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
...
xyz.openbmc_project.Sensor.Value interface - - -
.MaxValue property d 127 emits-change
.MinValue property d -128 emits-change
.Unit property s "DegreesC" emits-change
.Value property d nan emits-change writable
xyz.openbmc_project.Sensor.ValueMutability interface - - -
.Mutable property b true emits-change
...

The ValueMutability interface, with "Mutable", is correctly created.

Signed-off-by: Jie Yang <jjy@google.com>
Change-Id: Ifa1cb51bb55cd6f00d2a2f79e9064d1a51354b06
Signed-off-by: Josh Lehan <krellan@google.com>

show more ...


# e5fc3a55 10-Aug-2021 Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>

Compute IIO reading from raw with offset and scale

For IIO RAW sensors we get a raw_value, an offset, and scale to
compute the value = (raw_value + offset) * scale, thus scale changes

Compute IIO reading from raw with offset and scale

For IIO RAW sensors we get a raw_value, an offset, and scale to
compute the value = (raw_value + offset) * scale, thus scale changes
from a divisor to a multiplier.

Tested: on Rainier and Everest the sensors function the same before
and after this commit is applied.

Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
Change-Id: I1f6658107ac4a44e622ce01ced39ee0ecf8ee48b

show more ...


# a7345949 28-Apr-2021 Konstantin Aladyshev <aladyshev22@gmail.com>

hwmontemp: respect 'PowerState' parameter

Currently the hwmontemp app still reads sensor data even when the host
is powered off and a sensor has the '"PowerState": "On"' configuration

hwmontemp: respect 'PowerState' parameter

Currently the hwmontemp app still reads sensor data even when the host
is powered off and a sensor has the '"PowerState": "On"' configuration
parameter. Add a check to the 'setupRead' function to eliminate these
unnecessary read operations.

Tested on the AMD Ethanolx CRB with the SB-TSI sensors.
SB-TSI sensors don't work when the system is in the powered off state.
Moreover, timeout on a value read operation is too long and if the
hwmontemp app is constantly trying to read a sensor value this could
lead to the performance issues.

These commands were used to monitor transactions on the I2C bus:
$ echo 1 > /sys/kernel/debug/tracing/tracing_on
$ echo 1 > /sys/kernel/debug/tracing/events/i2c/i2c_read/enable
$ cat /sys/kernel/debug/tracing/trace_pipe

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Change-Id: I47267a006754222f0a869d86fc77dca228633351

show more ...


# 1263c3da 04-Jun-2021 Bruce Lee <Bruce_Lee@quantatw.com>

Modify set-value function from external

Move Special mode from bmcweb to dbus-sensors, this will be handled via dbus-sensor when the user set-value f$
This is unlikely to break a

Modify set-value function from external

Move Special mode from bmcweb to dbus-sensors, this will be handled via dbus-sensor when the user set-value f$
This is unlikely to break any users because the Intel special mode function is no change, only move to dbus-s$

The set value function is to filter the external set, excluding the internal set.
In the external set, if in INSECURE_UNRESTRICTED_SENSOR_OVERRIDE, no need to check before set value else add $

bmcweb needs to be merged at the same time.
bmcweb changes are pushed to Gerrit:
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/42448

the mailing list discussion links:
https://lists.ozlabs.org/pipermail/openbmc/2021-March/025597.html

Signed-off-by: Bruce Lee <Bruce_Lee@quantatw.com>
Change-Id: I0919e4d2343e81045010a2b0d4bf01dc272bcb07

show more ...


# 6b6891c5 22-Apr-2021 Zev Weiss <zev@bewilderbeest.net>

Add Unit property to dbus interfaces

Previously, the lack of the Unit property on the Value interfaces
provided by dbus-sensors meant that readings from its sensors weren't
displayed

Add Unit property to dbus interfaces

Previously, the lack of the Unit property on the Value interfaces
provided by dbus-sensors meant that readings from its sensors weren't
displayed in phosphor-webui/webui-vue. Here it's added as an extra
parameter to setInitialProperties, allowing sensors that handle multiple
types of data (e.g. IpmbSensor, PSUSensor) to determine the appropriate
string to pass once they've had time to determine that.

Tested: PSUSensor, ADCSensor, CPUSensor, TachSensor, and HwmonTempSensor
all have an appropriate Unit property available on dbus, and are
displayed in webui-vue.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I5e6df74cc42d9fb84852c5bf3ea5d3b383a16cdc

show more ...


# 7b7a9dea 21-Feb-2021 Jeff Lin <JeffLin2@quantatw.com>

Fix thresholds not found

Due to the same attribute name "thresholds" in class 'ADCSensor' and
'Sensor', the function hasWarningInterface use this parameter from class
ADCSensor and c

Fix thresholds not found

Due to the same attribute name "thresholds" in class 'ADCSensor' and
'Sensor', the function hasWarningInterface use this parameter from class
ADCSensor and cause it can not found the correct thresholds.

Rename the "thresholds" to "thresholdsIn" to avoid this problem.

Tested: Add thresholds to adc, cpu, hwmon and fan sensor and verify pass.

Signed-off-by: Jeff Lin <JeffLin2@quantatw.com>
Change-Id: I6a8a5f7036dd9f195a7848ff03fa5f51966c2d2d

show more ...


# 8a57ec09 09-Oct-2020 Ed Tanous <ed@tanous.net>

add clang-tidy

This commit implements a clang-tidy file, and makes some changes to get
it to pass. Most changes are naming or mechanical in nature.

Tested:
Clang-tidy now p

add clang-tidy

This commit implements a clang-tidy file, and makes some changes to get
it to pass. Most changes are naming or mechanical in nature.

Tested:
Clang-tidy now passes.

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia441e4801b6c8725421d160c531c5df141f255d4

show more ...


123