summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Use speed request base in inc/dec speed changesMatthew Barth2017-09-262-2/+13
| | | | | | | | | For increase and decrease speed changes, the new target speed is calculated from either a set speed request base value or the current target speed by default. Change-Id: Iad1411437a9945af0b9ae85649d487e36586ef2a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Zone function to set requested speed baseMatthew Barth2017-09-181-0/+16
| | | | | | | | The requested speed base is the speed value to base calculations for a new target speed of increases or decreases from. Change-Id: Iea413baa9c24c3240ddaf179b9faa259566f7e08 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* DOC ONLY: Example events yaml format updateMatthew Barth2017-09-181-40/+139
| | | | | | | | Made updates to the example events.yaml to reflect the new format and use. Change-Id: I13b323487565f0c1c29eb97d9ddcf8da3295b21c Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Set speed event parser updatesMatthew Barth2017-09-181-143/+202
| | | | | | | | | Added some optimizations in the event yaml format to nest set speed events that have the same preconditions and allow multiple actions to be taken within a single set speed event. Change-Id: I21ec395b6c9686e1efd5abc1be48d563480fec5f Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Support a list of actions for a set speed eventMatthew Barth2017-09-184-32/+78
| | | | | | | | | | Each set speed event will contain a list of one-to-many actions to perform for the given event group's property. This reduces the amount of code generated and properly handles property changed events against the group. Change-Id: If2b8c0d0b8ecf6e1c974c43d96e1c6e9e952022b Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Create fan monitor init modeMatthew Barth2017-08-235-37/+166
| | | | | | | | | | | | | Allowing fan monitor to run in an init mode will set the fans to a functional state at each poweron for fans that were non-functional at poweroff. Then fan monitor can be started in monitor mode after the fans have ramped up to full speed and can begin being monitored for faults. This also allows for the removal of fan monitor doing a sd_notify prior to fan control starting. Change-Id: I634c9b4ec8bb30860dea54c8abd1cd6c56831d25 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Create informational logs for properties not foundMatthew Barth2017-08-221-6/+7
| | | | | | | | | | | Fan control is allowed to have properties not be found, so log these as informational for users. If the property is not found, then any set speed events related to that property should handle it appropriately. Resolves openbmc/openbmc#2188 Change-Id: I7c9e5fc8a3291d19ab4b1853af340643d3fa67a2 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Updates enabling zone active fan controlMatthew Barth2017-08-164-28/+39
| | | | | | | | | | | | | | | A zone is actively controlling its fan speeds when all groups subscribed to allow active control are set to true. The zone keeps a list of these groups and their active allow state, if at anytime an action (or precondition) sets a group's active state to false, any dynamic set speed requests do not occur. Only requests to set the zone's fans to full speed is allowed. Related to this, the zone's target speed should only be updated when a requested speed is successfully set. Change-Id: Iec6f15346fee5a6c6046d5b00e949e46aef400b9 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add timer option to run set speed event actionsMatthew Barth2017-08-164-2/+90
| | | | | | | | | | | For groups within set speed events where the property values of the group may not signal its action to occur, an optional timer may be added to the event. This timer is configured as a repeating timer on the interval provided where upon timer expiration, the event's action is run. Change-Id: I4cbe8a0ab1b734bfc7828706a6515af7f6d78b52 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add factor parameter to inc/dec action functionsMatthew Barth2017-08-161-15/+23
| | | | | | | | | | | The factor parameter is used to correctly determine the increase or decrease speed delta based on sensor inputs that have a scale. To get the net speed delta change, the factor is applied to the difference in sensor value and the defined state at which a speed change should be requested. Change-Id: I2aaa8f6b294b38d1f38238593dd851c3a205eb7a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add interfacesAdded subscriptions to groupsMatthew Barth2017-08-141-13/+22
| | | | | | | | | | | | For each group in an event, subscribe to the interfacesAdded signals in the case where the member(s) of a group may or may not exist when initialized. Additionally, updated to use the propertiesChanged function to remove repetitive property change subscription lines generated. Change-Id: I52b0cd839383ebb90e93a81b5bac02ee7c4f44b2 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Handle any missing properties for actionsMatthew Barth2017-08-142-114/+167
| | | | | | | | | Update getting a property value from the zone's cache to throw an exception when not found. Handle these exceptions appropriately for each action where it gets each property value of a group. Change-Id: Icbc0b04f492d3680de77dbe3f27cabf7504ce6b4 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Update parser to support optional preconditionsMatthew Barth2017-08-082-12/+189
| | | | | | | | | | | | | | | | | Set speed events are now allowed to have preconditions defined within the event where those preconditions must be met before the set speed event is enabled and active. The supported precondition added is against a list of groups and their properties matching a given value. The parser generates a precondition with the same layout as a set speed event where the event is nested as the last parameter to the precondition function. Having the set speed event as the last input parameter to precondition functions is required. Resolves openbmc/openbmc#1835 Change-Id: I7a247e7eb2d6b31ba9a60da1bc321a35edda9b24 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Remove set speed eventMatthew Barth2017-08-074-19/+58
| | | | | | | | | Allows the complete removal of a set speed event from the zone. This is done when any precondition defined for the event to be active is not met any longer. Change-Id: Idbec357f76f0fd7db9107e8c9d3e00461872c528 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add precondition that checks property statesMatthew Barth2017-08-073-15/+74
| | | | | | | | | | The property state check precondition validates that each given property matches the defined value. When all the precondition groups' property states match, the given set speed event is initialized and activated allowing the zone speeds to be active controlled. Change-Id: Ic16a0e1fc584c6fa695e354fa80fb1993002ffc7 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add support to handle InterfacesAdded signalsMatthew Barth2017-08-071-0/+94
| | | | | | | | | | | | | | | | | | | | Set speed events can not subscribe to InterfaceAdded signals for properties that are created after fan control initializes the event. Fan control subscribes to property changed signals for all events upon startup where any properties that do not exist are unable to be subscribed to and be notified when their property changes. Therefore, subscribing to the InterfacesAdded signals for properties as well allows any property defined within a set speed event that may not exist upon starting the fan control application get added or updated when the interface it resides on is added. When a subscribed InterfacesAdded signal is caught, the same setProperty handler function will be used to add the property value for the object path, interface, and property name defined to be subscribed to for property change signals. Change-Id: If6fe97288140b83e2e2d735fdf61d52de1ec2e88 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Initial updates to support preconditionsMatthew Barth2017-08-044-38/+92
| | | | | | | | | | | | Any defined preconditions for a set speed event must be satisfied prior to configuring the event parameters for fan control. These preconditions will accept a list of group entries that include the value the group's property must be to have the precondition met for that group. Once all preconditions are met, the set speed event will be initialized and become active. Change-Id: Ia5555be55c5937c891af527bea63da1546655b2f Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* monitor: Remove static systemd match callbacksBrad Bishop2017-08-032-58/+6
| | | | | | | | Replace static systemd match callback wrappers with lamba methods. Change-Id: Ib8471478824d87483a60f527d29aa2d35ccb833f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* monitor: Use sdbusplus::bus::match::rulesBrad Bishop2017-08-031-5/+2
| | | | | Change-Id: I96ed7de07acfc864c497a0130c3e5afab579d21d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* monitor: Do not allow TachSensor moveBrad Bishop2017-08-031-2/+4
| | | | | | | | | TachSensor uses the this pointer as the systemd callback context for signal callbacks, which doesn't work with move semantics. Change-Id: I5e58fec9a7edfc457103d8a36f6076d90246f4f0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* monitor: Allow missing sensorsBrad Bishop2017-08-033-12/+37
| | | | | | | | Don't count sensors that don't exist as nonfunctional. Let some other application decide if missing sensors are a problem or not. Change-Id: Ie3d438c92df16bfd86ddc86db8a9dd143bf2cfb0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* monitor: Remove getServiceBrad Bishop2017-08-032-17/+0
| | | | | | | Remove getService from tach_sensor as it is no longer used. Change-Id: I568afb502379e05e85685d279033ab198c3cc91f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* monitor: Use common wrapper methodsBrad Bishop2017-08-031-32/+5
| | | | | | | | Replace the implementation of readProperty with a call to the common property accessor in sdbusplus.hpp. Change-Id: Ic4ba75bad7458a99f3e29c9235e1a54ae62286fe Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Allow existing bus connectionsBrad Bishop2017-08-031-6/+129
| | | | | | | | Overload the wrapper methods in sdbusplus.hpp for clients that already have a bus connection. Change-Id: I662385e6afe52179293ccbd41212d208e34bfbc5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* whitespace fixesBrad Bishop2017-08-031-42/+42
| | | | | Change-Id: Ibce6f79d4f4efb4a1605afc2958dd543f54ae726 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: Remove unused presence variableBrad Bishop2017-08-021-6/+0
| | | | | Change-Id: I72f801067ff09c91c53d32bf5ebb66fed3ec4dfc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Un-hardcode input device pathBrad Bishop2017-08-025-4/+12
| | | | | | | Allow a device path to be configured. Change-Id: I2eabd71747b124eae96738d1332f58b96ece6dc9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Allow missing tach sensorsBrad Bishop2017-08-021-4/+19
| | | | | | | | Do not allow missing tach sensors to abort the program. Instead, assume the fan is not spinning. Change-Id: Idc923b9c57b4d180aa16f0aa4933c65e7e4a2d42 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add parser support for any ofBrad Bishop2017-08-024-2/+46
| | | | | | | Add support for the anyof yaml keyword. Change-Id: Ib28ca8ef9959cec29cb2d15a0bf758668375895f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add any of redundancy policyBrad Bishop2017-08-023-0/+154
| | | | | | | | Add a bitwise logical or redundancy policy implementation (fan is present if any sensor indicates as such). Change-Id: I1d161478a4a6fe9d5690a385703e41c6fff9c81c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add sensor to redundancy policy apiBrad Bishop2017-08-025-5/+9
| | | | | | | | | | Include a reference to the sensor changing state when sensor implementations ping the policy object. This allows policy logic based on multiple sensors, simultaneously. Change-Id: I44cf00c7ecd220d0cc99e51ca6093bac6da7343c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add sensor comparisonBrad Bishop2017-08-023-1/+48
| | | | | | | Add a basic comparison operator for presence sensors. Change-Id: Ib147fd24f6e9ea1daf5f2b0b71943e0b4c96a8b7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Throw errors after sd_event api failuresBrad Bishop2017-08-022-9/+45
| | | | | Change-Id: Ie0635bc28fcd1a2fd96764674e15c71f1dcbe51a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add fallback testcaseBrad Bishop2017-08-022-0/+249
| | | | | Change-Id: Ic3390ba18d6f029fc16aee7492d51ac5f49bf2c0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add test directoryBrad Bishop2017-08-022-1/+8
| | | | | Change-Id: I1d0a8e7d4c442beb271c83d5ef6be3ca69c7c115 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Switch to new frameworkBrad Bishop2017-08-0213-591/+11
| | | | | | | | | Switch the main application logic to the output produced by the new parser previously. Remove unused code. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: If8b262bd80fd0f0135aeea55e578fb3c7f44339a
* presence: Invoke pfpgen.pyBrad Bishop2017-08-024-1/+19
| | | | | | | Invoke the new parser during build. Change-Id: I3a3c8c227a79e6f80a051c5e1d3a9a2b7f4e9656 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: New parserBrad Bishop2017-08-026-0/+533
| | | | | | | | | | | Adopt an easy on the tongue acronym similar to other projects. Add a robust parser with support for sensors and policies. Sensors: gpio, tach Policies: fallback Add an example yaml file. Change-Id: I9158a0ce2a08ef6b7bb3f5d659ea0e0433af5b96 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add fallback redundancy policyBrad Bishop2017-08-023-0/+181
| | | | | | | | | | | | Add a fallback redundancy implementation of the RedundancyPolicy interface. The fallback policy associates multiple PresenceSensor instances to a single fan, and "falls-back" on secondary sensor implementations when the primary sensor cannot see the fan. Change-Id: I6468d77d97b8916b3ff33bcd0cd28a102d1aaba1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add gpio presence sensorBrad Bishop2017-08-023-0/+206
| | | | | | | | | | | | Add a gpio presence implementation of the PresenceSensor interface. The gpio sensor simply maps the on off state of a gpio directly to the xyz.openbmc_project.Inventory.Item Present property. Change-Id: I071dd475bebb15372edb59506352746c20542eff Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add new tach sensor implementationBrad Bishop2017-08-023-0/+259
| | | | | | | | | | | | | Add a new fan speed (tach) presence implementation for the new PresenceSensor interface. This fan tach sensor behaves mostly like the existing one, with the addition of support for multiple tach sensors for the single PresenceSensor instance, and implementation of the PresenceSensor start and stop interfaces. Change-Id: I535a3e2c78ef0f06f10b6f4cda9a7e2d0e9c11db Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add redundancy policy interfaceBrad Bishop2017-08-021-0/+110
| | | | | | | | | | | | Add a redundancy policy interface class. Redundancy policies introduce the concept of multiple presence sensors for a given fan. A redundancy model implementation determines how the distinct sensors making up the redundancy set are controlled and how their feedbacks determine the overall fan presence state reflected in the inventory. Change-Id: Ibb5f71b3189dbb253bb669691e8016cda83a6ebb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add presence sensor interfaceBrad Bishop2017-08-021-0/+77
| | | | | | | | | | | | Prepare to extend the fan presence model to include sensors of other types with a presence sensor interface class. Presence sensors can be both event driven or polled. Provide start and stop for the former and present for the latter. Change-Id: Ia1b91a5e30e27fbe66c6f075e5e5ce620dac997e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add fan utilityBrad Bishop2017-08-023-0/+110
| | | | | | | | Add utility wrappers for reading/writing xyz.openbmc_project.Inventory.Item.Present. Change-Id: I9d6bb776e56b67b9cac1f991790886ec8105d4b1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* evdevpp: Add evmon utilityBrad Bishop2017-08-023-0/+177
| | | | | | | Add a sample/test ev event monitor program for evdevpp. Change-Id: I46dcc47b67b377a1abd79ceef3bc28dbf269d6f2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* evdevpp: Add test directory for libevdev wrappersBrad Bishop2017-08-024-2/+10
| | | | | Change-Id: Ib9d2e5cee2b9c1e28eb08c3c85f36f448160c16f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* evdevpp: Add C++ bindings for libevdevBrad Bishop2017-08-023-4/+133
| | | | | Change-Id: Iff27168588ee0767902801e6df3c6745a643ac9a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add sdevent singletonBrad Bishop2017-08-021-0/+27
| | | | | | | Avoid sdevent::event::Event reference proliferation. Change-Id: I5c3de11e902cd9e61fdaca8f06c73d329bf4d293 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add iotest for sdevent io wrapperBrad Bishop2017-08-023-0/+61
| | | | | Change-Id: I5f3054720e9c48248351c398b58f98f499799a0a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add test directory for sdevent wrappersBrad Bishop2017-08-024-2/+9
| | | | | Change-Id: I23843493e8f2c43ed50cdf1ad5def66a2f29dec3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud