commit | e97fc13a6f3253327b60120bd56c571efa29c2d0 | [log] [tgz] |
---|---|---|
author | Shawn McCarney <shawnmm@us.ibm.com> | Tue Sep 14 12:12:36 2021 -0500 |
committer | Shawn McCarney <shawnmm@us.ibm.com> | Tue Sep 14 20:32:56 2021 +0000 |
tree | 050c706ba57986c93f1606314e969147ad921838 | |
parent | c8cbeac2cada1032ba5f585956f818d671cbcc65 [diff] |
regulators: Fix race condition in monitor disable There is a systemd service file that disables regulator monitoring when the chassis is powered off. This is necessary because we do not want to read sensor values or check for phase faults when the chassis is powered off. Monitoring needs to stop before the regulators are disabled/turned off. The service file currently does not specify a 'Type', which means that it defaults to Type 'simple'. Service files of this Type are considered started when they fork the specified executable. That is, systemd does not wait for the executable to complete. In this case, we need the executable to complete. The service runs the regsctl executable, which makes a D-Bus method call to the regulators application disabling monitoring. We need this D-Bus method to complete before proceeding with the power off. Otherwise there is a race condition between the following: * The timers that initiate sensor and phase fault monitoring could expire, causing unwanted monitoring to occur during power off. * The regsctl executable could complete the D-Bus call, stopping monitoring and the associated timers. The solution is to set the Type of the service file to 'oneshot'. This causes systemd to wait until the executable completes. Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: I399a2a4ba7f1a256c42a7e9b8b036abd1b077033
This repository contains applications for configuring and monitoring devices that deliver power to the system.
To build all applications in this repository:
meson build ninja -C build
To clean the repository and remove all build output:
rm -rf build
You can specify meson options to customize the build process. For example, you can specify:
Several applications in this repository require a PSU JSON config to run. The JSON config file provides information for:
There is an example psu.json to describe the necessary configurations.
inventoryPMBusAccessType
defines the pmbus access type, which tells the service which sysfs type to use to read the attributes. The possible values are:/sys/bus/i2c/devices/3-0069/
/sys/bus/i2c/devices/3-0069/hwmon/hwmonX/
/sys/kernel/debug/pmbus/hwmonX/
/sys/kernel/debug/pmbus/hwmonX/cffps1/
fruConfigs
defines the mapping between the attribute file and the FRU inventory interface and property. The configuration example below indicates that the service will read part_number
attribute file from a directory specified by the above pmbus access type, and assign to PartNumber
property in xyz.openbmc_project.Inventory.Decorator.Asset
interface."fruConfigs": [ { "propertyName": "PartNumber", "fileName": "part_number", "interface": "xyz.openbmc_project.Inventory.Decorator.Asset" } ]
psuDevices
defines the kernel device dir for each PSU in inventory. The configuration example below indicates that powersupply0
's device is located in /sys/bus/i2c/devices/3-0069
."psuDevices": { "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0" : "/sys/bus/i2c/devices/3-0069", }