commit | 3291b9c755458663b284d87fda8f580f7673ff76 | [log] [tgz] |
---|---|---|
author | Jie Yang <jjy@google.com> | Thu Jul 29 14:46:51 2021 -0700 |
committer | Willy Tu <wltu@google.com> | Thu Oct 21 15:31:25 2021 +0000 |
tree | 871d4632fcc593861e4d35512552d49265f664fd | |
parent | b782eec69267206863c07f9ea26b475be7f0f291 [diff] |
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>
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