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
2 files changed
tree: 2c036a6f07f5641feecad208baf8f5602fed02ff
  1. include/
  2. service_files/
  3. src/
  4. subprojects/
  5. tests/
  6. .clang-format
  7. .clang-ignore
  8. .clang-tidy
  9. .gitignore
  10. Jenkinsfile
  11. LICENSE
  12. MAINTAINERS
  13. meson.build
  14. meson_options.txt
  15. README.md
README.md

dbus-sensors

dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.

key features

  • runtime re-configurable from d-bus (entity-manager or the like)

  • isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible

  • async single-threaded: uses sdbusplus/asio bindings

  • multiple data inputs: hwmon, d-bus, direct driver access

sensor documentation