commit | 6d50c3e9e184d3741eec13bd164518864fe806bf | [log] [tgz] |
---|---|---|
author | Brandon Kim <brandonkim@google.com> | Fri Aug 09 15:38:53 2019 -0700 |
committer | Brandon Kim <brandonkim@google.com> | Fri May 07 19:09:11 2021 +0000 |
tree | 3de9c83d73bb51dbd1514145fd3380799bc5563f | |
parent | d46d081895ada3ab411996dc3a681f796f4a0926 [diff] |
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>
Exposes generic hwmon entries as DBus objects. More information can be found at Sensor Architecture
To build this package, do the following steps: 1. meson build 2. ninja -C build To clean the repository run `rm -rf build`.
To enable the use of Linux features like cgroups prioritization and udev/systemd control, one instance of phosphor-hwmon is intended to be run per hwmon sysfs class instance. This requires an algorithm for selecting a stable, well-known D-Bus busname. The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default), ID is either a std::hash of the /sys/devices path backing the hwmon class instance or provided suffix value from the command line, and N is the implemented phosphor-hwmon D-Bus API version.