summaryrefslogtreecommitdiffstats
path: root/control
Commit message (Collapse)AuthorAgeFilesLines
* Allow no parameter action functionsMatthew Barth2017-09-281-22/+41
| | | | | | | Action functions are not required to have parameters. Change-Id: I04bf8294d9be9141cc7d8d3183628c94b777154a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Create set request speed base action functionMatthew Barth2017-09-283-166/+235
| | | | | | | | | | | | | | | | | This action function is intended to allow the base request speed to be set to the max value from a group of properties. The base request speed is the base speed used in requesting a new target speed. By default, the base request speed is the current target speed. For example, this action can be used to set the base request speed used in calculating a new target speed to be based on the max tach feedback speed from a group of fans instead of the current target speed. Adding this action function requires the other non-template functions to also be slightly modified due to linker errors. Change-Id: Ibbe9b33678b10cb49466174088a587b27bf56d62 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* 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 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>
* Fan control: Example yaml updates(doc only)Matthew Barth2017-07-062-1/+61
| | | | | Change-Id: I30fdecd3af3dcdc7f954bdb9d535c6bc92edd67a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add increase & decrease timer values in secondsMatthew Barth2017-07-064-7/+32
| | | | | | | | | | | | | | | | | Support setting the increase delay time(in seconds) for each zone from the zone yaml file. Speed increases use a delay type timer where the amount of time given delays additional increase requests from happening until the fans within the zone reach the highest net increase in speeds. Support setting the decrease interval time(in seconds) for each zone from the zone yaml file. Since decreasing is done on an interval, a decrease interval time of zero disables the decrease interval timer causing no decreases in speed to occur. Speed decreases use an interval type timer to decrease the fan speeds within the zone when no speed increase requests exist on the given time interval. Change-Id: I88334a313b6e2820b768fa7e3f1cb65887f29258 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Set target speed according to floor speed changeMatthew Barth2017-07-062-15/+18
| | | | | | | | When the floor speed updates, a request to increase the target speed should be made when the target is now below the floor speed. Change-Id: Ib622bc717a952ef0c0703cbff40a4dc14b213416 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Timer for fan speed increasesMatthew Barth2017-07-062-7/+30
| | | | | | | | | | | | | A oneshot timer is started on each target speed increase where the amount of time configured is how long the fans within the zone are allowed to reach the new target speed before additional speed increase requests will be processed. Any speed increase request deltas that are above the current speed increase delta being processed as the new target speed will cause the timer to stop and the difference between the deltas are added onto the target speed. Change-Id: I064941c4e12c3e44be90880d6f32c6fbcf7ae32d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Move event init steps at startup to functionsMatthew Barth2017-07-062-47/+69
| | | | | Change-Id: I8a281935368cd705658d489c7c7af59b8dde7e4d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Timer to decrease fan speedsMatthew Barth2017-07-065-11/+62
| | | | | | | | | Create a repeating timer for decreasing fan speeds where the fan speeds in the zone are decreased when the timer expires and a decrease speed request exists with no increase request present or active. Change-Id: I419592f6f50c0ed524f8bf3ebf183854ab5ef2ea Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Support speed decrease eventsMatthew Barth2017-07-063-5/+105
| | | | | | | | | | | | | | | | | A net decrease speed action determines the net decrease delta from each group member's property value and requests a speed decrease of that delta from the current target speed. From all the requests for a speed decrease on a zone, only the lowest net decrease is used from all the groups subscribed to decrease a zone's speed. The new target speed is only decreased when no increase requests exist and the resulting target is above the zone's floor speed, otherwise the floor speed is set as the new target. Resolves openbmc/openbmc#1626 Change-Id: Iaefa7b25c3f44691dd3ca4084bfddd3c1a504de9 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Process speed increase requestsMatthew Barth2017-07-063-6/+43
| | | | | | | | | | | Speed increases are made providing a target speed delta. The increase is made when the delta is higher than the current increase that may be occurring. When no increase is currently happening, the increase delta requested is accepted. All resulting target increases will not go above a defined ceiling speed. Change-Id: Ia19c71a023cf5b897d5ba92974ff98451f34d5a3 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add zone net increase set speed actionMatthew Barth2017-07-062-0/+60
| | | | | | | | | The net increase speed action provides the ability to determine what the net delta the zone's fan speeds should be updated by from their current target speed. Change-Id: Ib463e5ed4836bebf906cea27ea5788d826ec9c38 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Enable setting/adjusting fan ceiling speedMatthew Barth2017-06-283-1/+166
| | | | | | | | | | | | | | | | | Set the default ceiling to be what's given as full speed and adjust the ceiling speed based on an average of a given set of sensor values. The ceiling is chosen from a given map's key transition values. The map consists of key, value pairs where each key is the sensor value transition point and the value is the ceiling speed for when that transition occurs. The previous key value is needed to determine the direction in which to chose the appropriate ceiling speed allowing a buffer zone between ceiling changes if defined to. Resolves openbmc/openbmc#1628 Change-Id: I7c9c553b5d0c3219c51b563aec7dd5d5f090916b Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* phosphor-fan-presence elog error exception.Dinesh Chinari2017-06-284-23/+33
| | | | | | | | Implemented elog exception for phosphor fan presence, replacing runtime_errors. Change-Id: I70465060838b2cbaeadccf84ed5924e222ac59e3 Signed-off-by: Dinesh Chinari <chinari@us.ibm.com>
* Allow generation of map types in eventsMatthew Barth2017-06-261-1/+15
| | | | | | | Resolves openbmc/openbmc#940 Change-Id: I238cd4a6ef69c1d54a775ad90ee87e6e327b82bd Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Allow floor speed changes based on sensor valuesMatthew Barth2017-06-263-0/+70
| | | | | | | | | | Given a group of sensor values, the average of those sensor values will be used in selecting the floor speed for the zone. Each time the speed is set/updated, any speed requested lower than the current floor will be overwritten with the floor speed to not allow speeds below the floor. Change-Id: I4c8e8a2cd66892b9fdc2bc5643e907adddff51f8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add default floor speed supportMatthew Barth2017-06-264-4/+25
| | | | | Change-Id: Id2d3b362e79e7a8c2330181f68ae11e43f84e2fd Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Properties stored of different typesMatthew Barth2017-06-264-16/+20
| | | | | | | | Allow properties stored for processing events to be of types other than bool Change-Id: Ie1dde5aca562c9958bdff6fa3d1b19d3154b2c6d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add interface to uniquely identify propertiesMatthew Barth2017-06-265-5/+16
| | | | | | | | The interface is needed on the properties stored to uniquely identify each property used in events. Change-Id: Ia062f25514d7ed04ef1023a02eecad4738711ffb Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Check for zone number and conditionGunnar Mills2017-06-261-6/+17
| | | | | | | | | Only add events to the zone if the conditions and zone number are correct. Resolves openbmc/openbmc#1500 Change-Id: Ia040fcbdd9093d25d4ed1773d5fea0ed8a95ba2b Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Example zone conditions yamlGunnar Mills2017-06-261-0/+32
| | | | | | | | An example yaml file for zone conditions to be used to create the correct fan zones. Change-Id: I6ca339a3a9f37bc70424cde57f2229a5dcb70cbb Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove TBD on zone conditions in zones.yamlGunnar Mills2017-06-261-1/+1
| | | | | Change-Id: I8eb215aaf90ef9553a52e8eaa54d3fd1a1a00ca5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Evaluate conditions to determine zoneGunnar Mills2017-06-262-15/+108
| | | | | Change-Id: Idb825b27ecf98503ddc2405a0cafc30c644efc71 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* pep8 style changesGunnar Mills2017-06-261-5/+5
| | | | | | | Fixed pep8 warnings in gen-fan-zone-defs.py Change-Id: I78472a1e9ce1bd6eb14e0352398c6470fa144604 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Parse zone conditionsGunnar Mills2017-06-261-6/+69
| | | | | | | Zone conditions are used to determine which zone to use. Change-Id: I11f0ffa4da12532aeedf88941fb8a2d7fca5d352 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Use updated match methods for signal callbacksMatthew Barth2017-06-054-46/+23
| | | | | | | | Attach the event handler callback function to the match along with generating the match string using the new match methods Change-Id: I7595d65cbc615f29db60e2a65534ee5b635d6f96 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Check initial event's group members' propertiesMatthew Barth2017-05-312-0/+68
| | | | | | | | On start of fan control, check the current event's group members' property states and envoke the defined action function on the results. Change-Id: I12509403328d90f85d67b393dbdd97d8710c83ef Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add an active state for automatic fan controlMatthew Barth2017-05-313-1/+38
| | | | | | | | | | | | Each zone contains an active state that determines whether the automatic fan control algorithm is active and controlling the fan speeds dynamically or not. This will be used to determine if the fan speeds within the zone are set dynamically or rather held at another speed for a determined reason. Change-Id: I2f81de168c5f7d859b3ec917022c4749e1a28d4e Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Only setup set speed events when not init modeMatthew Barth2017-05-315-33/+42
| | | | | Change-Id: Ia6987295a3eb4e23b9d6ae13a383e440386572de Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Fixed alignment issuesMatthew Barth2017-05-311-61/+65
| | | | | | | Fixed resulting pep8 alignment issues in the generated template Change-Id: I26d316a86c40896cda729683b26ccf06a3f89d5f Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Generate list of property change signalsMatthew Barth2017-05-311-0/+31
| | | | | | | | Add the list of property(s) associated to a set speed event where the handler updates the property cached on the zone for the action Change-Id: Ifac61dda6eb200ca28735ddfaab3d34c9a9df758 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Generate set speed event actionsMatthew Barth2017-05-311-0/+38
| | | | | | | | Adds the set speed event action functions with the associated parameters in the order required for the function Change-Id: Ib08f2442d8ff1fb3d49ab5234eacc2db8304a20d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Parse set speed event groupsMatthew Barth2017-05-311-2/+56
| | | | | | | | Adds the groups for a set speed event for each zone listed within the event. The groups are for maintaining a cached property value. Change-Id: I2de9cf62215f9861e8ea2e6807df11e6a04638fb Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Example set speed event yamlMatthew Barth2017-05-311-0/+67
| | | | | | | | | An example yaml file to define set speed events based on groups of dbus object properties and a set of actions that can be performed based on those property values Change-Id: I2f713920f9ce25859855cfec783df0adb505f31d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add setting zone speed actionMatthew Barth2017-05-315-21/+118
| | | | | | | | Enable an action to be defined that sets the zone to a given speed when a number of properties are set to a given value Change-Id: I5252a20a24bdb14dee63080f2c08b080c82ad7e8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud