commit | 5170fe63cc84b96d67b33f2b7f9001c0ecfa7d1a | [log] [tgz] |
---|---|---|
author | Josh Lehan <krellan@google.com> | Wed Aug 03 13:17:41 2022 -0700 |
committer | Ed Tanous <ed@tanous.net> | Tue Aug 09 04:48:57 2022 +0000 |
tree | 1d0d1a0b9c0ad607c7d2787f77f9b1c770f6bfa3 | |
parent | 1ff2e669db5eca302851e72a77d2cd608a7666ac [diff] |
tachsensor: Similar fixes from HwmonTempSensor Ported the substance of the changes from here to TachSensor: https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/56019 The goal is to provide similar fixes to I/O and buffering, catching up to similar changes made recently in HwmonTempSensor. Tested: Fan RPM now shows up correctly on my machine again. Signed-off-by: Josh Lehan <krellan@google.com> Change-Id: I49c539e3713e9d02d4584f305e4ced6d4b2ba572
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.
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
A typical dbus-sensors object support the following dbus interfaces:
Path /xyz/openbmc_project/sensors/<type>/<sensor_name> Interfaces xyz.openbmc_project.Sensor.Value xyz.openbmc_project.Sensor.Threshold.Critical xyz.openbmc_project.Sensor.Threshold.Warning xyz.openbmc_project.State.Decorator.Availability xyz.openbmc_project.State.Decorator.OperationalStatus xyz.openbmc_project.Association.Definitions
Sensor interfaces collection are described here.
Consumer examples of these interfaces are Redfish, Phosphor-Pid-Control, IPMI SDR.
dbus-sensor daemons are reactors that dynamically create and update sensors configuration when system configuration gets updated.
Using asio timers and async calls, dbus-sensor daemons read sensor values and check thresholds periodically. PropertiesChanged signals will be broadcasted for other services to consume when value or threshold status change. OperationStatus is set to false if the sensor is determined to be faulty.
A simple sensor example can be found here.
Sensor devices are described using Exposes records in configuration file. Name and Type fields are required. Different sensor types have different fields. Refer to entity manager schema for complete list.