commit | bcf76717697238e380be785bd28150963ecf0e9e | [log] [tgz] |
---|---|---|
author | Kuiying Wang <kuiying.wang@intel.com> | Fri Mar 19 11:17:58 2021 +0800 |
committer | Ed Tanous <ed@tanous.net> | Tue Jul 06 14:42:53 2021 +0000 |
tree | 42485abdfef6a054205869980279d05077479e21 | |
parent | 8685b17ab14a187eae08399153b9ec6bace2ab9b [diff] |
Ensure PSU sensor values are refreshed A server managed by OpenBMC may have more than a single power supply. In the event that one or more PSU's have AC removed, or are removed from the system, the PSU sensors should reflect the loss of the input power from the PSU. This condition was not being reflected when using the current PSU sensor code. AC loss from a single PSU resulted in the output power value remaining greater than zero. This was due to the use of the ASIO async_read_until function. The ASIO async_read_until function can only be used on well behaved interfaces that will not fail. The hwmon files being read do not conform. Reads can result in an EAGAIN error code. The async_read_until documentation states EAGAIN is not handled. The code changes in this commit are lifted from the IPMB bridge source. The hwmon file containing the sensor reading is opened so that it is non-blocking. The sensors are read when the kernel indicates a change has been made. Subsequent reads occur only after a delay time has expired in order to prevent too many reads from being performed, and thus consuming CPU time. Tested: The SUT is a dual PSU system. Both PSU's are enabled at the beginning of the test. Run 'ipmitool sensor list' and inspect the PSU state * All input/output voltages/currents are presented Remove AC from PSU1 Run the ipmitool command again, and see that the values for PSU1 change state, reflecting the power loss. * Prior to this change the output power values stalled Restore AC to PSU1 Run the ipmitool command again, and see that the values for PSU1 are restored. Remove AC from PSU2 The ipmitool values will reflect the loss of voltage/current/power * Prior to this change the output power values stalled Restore AC to PSU2 The sensor values for PSU2 will be present again. Change-Id: Id3fea32722044f3e3b106cd0be11f6f43c038011 Signed-off-by: Kuiying Wang <kuiying.wang@intel.com> Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.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