summaryrefslogtreecommitdiffstats
path: root/control/zone.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Official release under GPL v304-16-2019Raptor Engineering Development Team2019-04-191-1/+1
|
* Add PID control option to fan controllerRaptor Engineering Development Team2019-04-191-0/+50
|
* Add fan shutdown option to stop rotors after chassis powerdownRaptor Engineering Development Team2019-04-191-1/+9
|
* Persist zone object properties optionMatthew Barth2019-02-181-0/+28
| | | | | | | | | | | | | Add functions to set and get persisted properties on a zone by the interface and property name. When a property exists, it is persisted each time it is updated. Tested: Current property is added and persisted. When Current property not added, it is not persisted. Change-Id: I2540c3673affcda871c9342cad44e85a4510d756 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Store and access zone object propertiesMatthew Barth2019-02-131-0/+65
| | | | | | | | | | | | | | | | | | Properties on the zone object require their event data to be stored for retrieval when their value changes, which allows the use of the current event handlers to update the cached value and trigger the event actions. When any event is initialized, any signals where the match string is empty performs a lookup for each group member to determine if they are on the zone object. Each member found to be on the zone object is then stored with the that event's data. Tested: Verified event data is stored for members on the zone object Verified event initialization correctly accesses zone object member's event data Change-Id: Id34f60eb12330428eeb1041de4e9bd1a4a686f21 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Override setting Current mode propertyMatthew Barth2019-02-131-0/+9
| | | | | | | When the Current mode property changes, the persisted value is updated. Change-Id: I319fbe2afb8112f7425dc0a1d765fe8f1c408bae Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Restore current mode propertyMatthew Barth2019-02-131-0/+6
| | | | | | | | | | When the fan control zone is created, the current mode property is restored from persistent storage. If the persistent storage file does not exist or fails to be read, the current mode property is set to default. Change-Id: I5ba699f9b6683aea4f39444eace8c7d19a22c92d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Persist current mode property frameworkMatthew Barth2019-02-131-0/+6
| | | | | | | | Add the ability to save the current mode property value to persisted storage. Change-Id: I354fce7c11a61871a49c9b205dc79ee598f8b1c8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add thermal control interface to zone objectsMatthew Barth2019-02-131-1/+12
| | | | | | | | | | | | | When in control mode, the thermal control interface and mode property are added to each zone object. The object path for each zone consists of the configured object path plus the zone number. Ex) /xyz/openbmc_project/control/thermal/0 Tested: After fan control is started in control mode, dbus interface exists Change-Id: I88578a7e0eb7c730ffaa4cfc10989e280dc1d46d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Remove timer in favor of sdeventplus/utility/timerWilliam A. Kennington III2019-02-051-9/+4
| | | | | | | | | | | This removes the custom timer implementation and moves to the sdeventplus utility. Functionally this should make no change Tested: Built and run through the unit test suite. Change-Id: Ib7ee90d489d5db72496aaaca91c3cf5490ad47d6 Signed-off-by: William A. Kennington III <wak@google.com>
* control/zone: Fix missing cassert includeWilliam A. Kennington III2018-11-121-0/+1
| | | | | | | | | This was relying on sdbusplus to provide a transitive include for <cassert>. Since we are directly using the assert() call we should include <cassert> ourselves. Change-Id: I095af26c7a589ab337facc6ac2d0c4983a0f0c2c Signed-off-by: William A. Kennington III <wak@google.com>
* Remove all signals when an event is removedMatthew Barth2018-11-061-0/+40
| | | | | | | | | | | | | | Each event could have multiple signals associated and when the event is removed, all of those signals should also be removed. This ensures no dangling signals remain after an event is removed from be processed by fan control Tested: The total number of signals subscribed are reduced by the same number of signals of a removed event Change-Id: I651f70dbe6aed9c7eef06aff4eac9eae7ad89d77 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* control/zone: Reference instead of copying timer dataWilliam A. Kennington III2018-11-051-1/+2
| | | | | | | | Tested: Built and ran through unit tests. Change-Id: I9a98d9a3eaee47885b18b642ffd01a38a864dd02 Signed-off-by: William A. Kennington III <wak@google.com>
* control/zone: Refactor addTimerWilliam A. Kennington III2018-11-051-8/+6
| | | | | | | | | | | | Anything adding a timer uses roughly the same process of building the event data and timer from the event group, actions, and timer config. We can adjust the method to do this for all callers. Tested: Builds and passes unit tests. Change-Id: I4013ff2f7bff65095a6e1db7075bc013da374f51 Signed-off-by: William A. Kennington III <wak@google.com>
* Switch sd_event loops to sdeventplusWilliam A. Kennington III2018-10-291-8/+9
| | | | | | | | | This change is mostly focused around plumbing the sdeventplus::Event object everywhere and using the member functions provided for the event. No migration to the timer utility is performed yet. Change-Id: I912ab82bc081239d3b7c3cf7c5caca6742ef9c87 Signed-off-by: William A. Kennington III <wak@google.com>
* Rename remove object interface functionMatthew Barth2018-04-121-2/+2
| | | | | | | | | | Update the removeObjIntf function name to removeObjectInterface. This was requested per a review comment. Tested: N/A Change-Id: I52589724685bb5b8d92d3da22072b63b43f69a01 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add InterfacesRemoved signal handlingMatthew Barth2018-03-301-0/+16
| | | | | | | | | | | | | | | When an InterfacesRemoved signal is received for a subscribed object path, each interface returned is checked against the interface which was defined for each object on the event. When these are equal, the interface (and all associated properties) are removed from the shared cache of event properties. Tested: Manually added an InterfacesRemoved signal Verified interface was removed from object path in cache Change-Id: I348d82f14e0cfba2b18a81a9f54c6cb06b586797 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Cache service names for paths and interfacesMatthew Barth2018-03-121-0/+35
| | | | | | | | | | | | | | | | To lookup a service name for a given path and interface, use GetSubTree to retrieve all the service names from the root path for the interface and add each entry to a cached dataset. Tested: Check that a missing interface's service is added Check that a missing path that exists has its service added Inspect all missing paths for an interface are added Inspect missing interfaces are added to existing service Returned service name matches the service for a path/interface Change-Id: I6db05479e825350198896b2e237882f7ebc58d51 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Decreases allowed based on all groupsMatthew Barth2017-12-141-0/+16
| | | | | | | | | | | | | | | For speed decreases to occur, all sensor groups involved with setting a net decrease delta must be below their given t-control low values for the associated zone. This handles the case where one or more sensor groups' temperatures stabilize above their t-control low value, but one or more other sensor groups' temperatures are below their t-control low value which would result in speed decrease requests that could eventually lead to fan speed oscillations. Resolves openbmc/openbmc#2710 Change-Id: I382de5d3f9c3e631a332d49dfcb06e705ff6fc17 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Disable zone move constructorMatthew Barth2017-11-211-1/+1
| | | | | | | | To ensure no future enhancements attempt to store a reference to the zone object that are used to allow zone function calls. Change-Id: I0dc266445abdbce86b5fd505589aa96b7730c29a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Remove empty service nameMatthew Barth2017-11-171-0/+9
| | | | | | | | | | Before refreshing the service names and states for a group, the empty service name should be removed if it exists. An empty service name may exist where upon startup, a particular service was not found for a member or members of a group. Change-Id: I15d224231bb9db0823866393ec1776f793a3c126 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Refresh service states for a groupMatthew Barth2017-11-171-0/+7
| | | | | | | | | | | Prior to an action resulting from missing service owners, all of the services for a group should be refreshed to ensure they are in the most up-to-date state. Ensuring the service states are current allows the action to be correctly taken since owners of services could change at anytime. Change-Id: I59c59c6fcf456fa9c0a733d6406c90ea11f6e2b2 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Set floor to default on missing owner actionMatthew Barth2017-11-171-1/+18
| | | | | | | | | | | | | | An action to set the fan floor speed to the defined default fan floor speed when any services associated to a given group of sensors have terminated. Once those services are functional and providing the sensors, the fan floor is allowed to be set normally again. i.e.) For fan floor speeds based on an ambient sensor, if the service providing the ambient temperature value from the sensor terminates, the default floor for the zone is used as the fan floor speed. Change-Id: I2d58cc9b31051e6b8e5e798c0a736f58f5efe5b1 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add timer event managementMatthew Barth2017-11-171-1/+72
| | | | | | | | | | Events defined to have timers require the ability to find a timer, add a timer to the event, and removing a timer event entirely. These event timers are intended to allow actions based on the event to be delayed or recurring based on the timer defined. Change-Id: Ieaf26f031c5e5aac9472e92354bfb76392642cb4 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Set/update a service name owner for a groupMatthew Barth2017-11-171-0/+16
| | | | | | | | | Adds a service name associated with a group when the group or given service name is not found within the map of services otherwise updates the service name owner associated with the group. Change-Id: I602ddaa7e06e354e01ea70d6c5c0a45e74a14e99 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Update event initializationMatthew Barth2017-11-171-28/+0
| | | | | | | | | | | | | | | | Using a null dbus message to the event signal will perform the necessary steps to initialize the event parameters using the given signal handler's function directly. i.e.) In the case for subscribing to PropertiesChanged signals, initially the given property must be read. When the PropertiesChanged signal struct is given a null message, it finds the property, reads the value, and then can perform the given signal handler function directly. This produces the same functional path as receiving a PropertiesChanged signal containing the property value within the message. Change-Id: I35575cfff66eb0305156be786cb1f5536d42bb1c Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Use speed request base in inc/dec speed changesMatthew Barth2017-09-261-0/+11
| | | | | | | | | 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>
* Support a list of actions for a set speed eventMatthew Barth2017-09-181-4/+4
| | | | | | | | | | 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>
* Updates enabling zone active fan controlMatthew Barth2017-08-161-10/+4
| | | | | | | | | | | | | | | 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-161-0/+19
| | | | | | | | | | | 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>
* Handle any missing properties for actionsMatthew Barth2017-08-141-1/+1
| | | | | | | | | 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>
* Remove set speed eventMatthew Barth2017-08-071-8/+9
| | | | | | | | | 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-071-7/+23
| | | | | | | | | | 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>
* Initial updates to support preconditionsMatthew Barth2017-08-041-3/+3
| | | | | | | | | | | | 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>
* Add increase & decrease timer values in secondsMatthew Barth2017-07-061-0/+11
| | | | | | | | | | | | | | | | | 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-061-10/+8
| | | | | | | | 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-061-0/+11
| | | | | | | | | | | | | 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-061-0/+20
| | | | | Change-Id: I8a281935368cd705658d489c7c7af59b8dde7e4d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Timer to decrease fan speedsMatthew Barth2017-07-061-0/+14
| | | | | | | | | 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-061-0/+23
| | | | | | | | | | | | | | | | | 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-061-0/+13
| | | | | | | | | | | 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-061-0/+15
| | | | | | | | | 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-281-0/+50
| | | | | | | | | | | | | | | | | 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>
* Allow floor speed changes based on sensor valuesMatthew Barth2017-06-261-0/+15
| | | | | | | | | | 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-261-0/+15
| | | | | Change-Id: Id2d3b362e79e7a8c2330181f68ae11e43f84e2fd Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Properties stored of different typesMatthew Barth2017-06-261-5/+7
| | | | | | | | 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-261-3/+10
| | | | | | | | 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>
* Use updated match methods for signal callbacksMatthew Barth2017-06-051-18/+7
| | | | | | | | 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-311-0/+16
| | | | | | | | 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>
OpenPOWER on IntegriCloud