summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Use in place init of event dataMatthew Barth2017-11-172-17/+8
| | | | | Change-Id: Ia56acbeaa89423060e65e50eff8accffec5a4631 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Remove empty service nameMatthew Barth2017-11-172-1/+37
| | | | | | | | | | 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-173-0/+41
| | | | | | | | | | | 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>
* Init zone target speed to current target speedMatthew Barth2017-11-173-1/+36
| | | | | | | | | | | | | | Whenever fan control (control mode) is started, the target speed for each zone should be initialized to the currently set target speed. In the case where a watchdog has triggered the fans to full speed and the target speed does not reflect this, the proper set of set speed events should be configured. In this case, an event could be defined to use the current tach feedback to adjust the target speed prior to account for the real state of the fan speeds. Change-Id: I538644ffc83a6e01469174304d393c889038d066 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Set fan speed on missing owner actionMatthew Barth2017-11-172-0/+35
| | | | | | | | | | Sets the zone's fan speeds to a given speed when any service owner associated with an event group is missing. Once all the services are functional and providing the event data again, active fan speed changes are allowed. Change-Id: I318f6114c8d0392432c421f803db07a4683d1097 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Set floor to default on missing owner actionMatthew Barth2017-11-174-5/+60
| | | | | | | | | | | | | | 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>
* Allow timers & embedded actions within an actionMatthew Barth2017-11-171-28/+64
| | | | | | | | | Add support for timer parameters to action functions along with recursively build action functions that are a parameter to an event action. Change-Id: Ic126c8dfc85d5ede5f53034262f8910913e4cdd4 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Modify generating event actionsMatthew Barth2017-11-171-15/+10
| | | | | | | | Move to constructing the entire event action parameter string within the python code in prep for additional special parameters. Change-Id: I517ad859813e348cd6781cc9be11ab92fa6cac09 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Action that creates/starts a timerMatthew Barth2017-11-172-0/+85
| | | | | | | | Another action is provided to the timer and is performed when the timer expires. Change-Id: Ie6a06b0d56272a158d74bf03287183f07f00aed8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add timer event managementMatthew Barth2017-11-173-4/+121
| | | | | | | | | | 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>
* Add timer type for set speed event timersMatthew Barth2017-11-173-4/+10
| | | | | | | | This is the first step towards allowing timer driven and/or wrapped actions where the timer interval and type will be defined by the user. Change-Id: If008fda5a2b73117e869f93223e0bfe61290f858 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Fill in NameOwnerChanged signal supportMatthew Barth2017-11-172-3/+38
| | | | | | | | | | A NameOwnerChanged signal message provides three strings containing the service name that has changed along with its old service owner name and new service owner name. These names are then passed along to the handler to find/update the group associated with the changed owner name. Change-Id: I7d67883b010fec5b282bd00a4dcc29629486af00 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Generate selected handlersMatthew Barth2017-11-171-48/+125
| | | | | | | | The available event handlers are listed within the events yaml and would be selected per event. Change-Id: Ia393009b3a10b6f47f5de9a0e6d44f804576f05a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Set/update a service name owner for a groupMatthew Barth2017-11-173-0/+50
| | | | | | | | | 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>
* Stub NameOwnerChanged signal supportMatthew Barth2017-11-172-0/+87
| | | | | | | | | NameOwnerChanged signals will be used within fan control to configure set speed events for when services providing parameters to the fan control application have unexpectedly terminated. Change-Id: I04f3c7ca2842732e33dc94b0280ad4483f7f1286 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Update event initializationMatthew Barth2017-11-176-151/+199
| | | | | | | | | | | | | | | | 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>
* Fix up InternalFailure to include metadataMarri Devender Rao2017-11-164-11/+44
| | | | | | | Scope is to add missing logs for InternalFailure errors Change-Id: I12c958127c1303fba0057914682e651457a0e547 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Generate selected match strings and signalsMatthew Barth2017-11-074-83/+185
| | | | | | | | | The available matches and their associated signals are now listed within the events yaml and can be added to the list of matches to register for per event. Change-Id: I65f657038afe7c68a421adb4820ea09e275be06d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* DOC ONLY: Add preconditions section descriptionMatthew Barth2017-11-061-0/+6
| | | | | Change-Id: I260319dbfc4cb87bfed8fd724ffc4978f34e7325 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Spelling fixesGunnar Mills2017-10-253-4/+4
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Iefb2ad70d313a4800cd413c7c2e5e2154bec49fb Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* monitor: Start checking tach trustMatt Spinler2017-10-113-2/+27
| | | | | | | | | The Fan class now uses the trust::Manager class to ask if a sensor value is trusted before analyzing its value against the upper and lower limits. Change-Id: I81dd468877873ba84753d76395b4a59129824c0b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* monitor: Update YAML parser to handle trust groupsMatt Spinler2017-10-113-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It creates a list of group creator lambdas based on the information in the monitor YAML file. These lambdas are called by the manager class to create the trust group instances. A real life example is: const std::vector<CreateGroupFunction> trustGroups { { []() { std::vector<std::string> names{ "fan0_1", "fan1_1", "fan2_1", "fan3_1", }; return std::make_unique<NonzeroSpeed>(names); } }, }; Change-Id: Ia883df35efb86242aae2f8ed7d1714e94e65a6e6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* monitor: Update example YAMLMatt Spinler2017-10-111-1/+21
| | | | | | | | Update the YAML documentation with sensor trust information. Change-Id: Ia5407b079b5dcfbd4063cec8dbba032fefa11b6b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* monitor: Add trust manager classMatt Spinler2017-10-112-0/+151
| | | | | | | | | | | | | | | This class contains the trust groups, and is the interface for asking if a sensor value can be trusted or not. It will also start and stop timers on all sensors in the same group as the timer in question whose trust value just changed. This class will be used by the Fan class in the speed change callback function to check if a sensor is trusted before analyzing its value. Change-Id: I134be095b6b5222f7bc0e457078cf01f75a36219 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* monitor: Add NonzeroSpeed trust group classMatt Spinler2017-10-111-0/+63
| | | | | | | | | | | | | | | | | This class provides the ability to only trust the sensors in the group if at least one of them has a nonzero speed. It is being used for a system where the tach values for a set of rotors are reported as zero by the fan controller hardware when the other rotor on the fan is moving to a new target speed. As all the fans are set to the same speed at the same time, the rotors in question all report as zeros at exactly the same time, and this is then used to know when the values cannot be trusted. Change-Id: I29a014014bc8455287f90e5b573a856814331a53 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* monitor: Add tach sensor trust group classMatt Spinler2017-10-113-1/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The trust::Group class is an abstract base class that introduces the concept of knowing if a tach sensor reading can be trusted or not. If it isn't trusted, then it shouldn't be used when calculating if the fan is considered functional or not. It's a group because it supports groups of sensors all having the same trusted status. For example the first use case is a group of sensors cannot be trusted when all of their readings are zero. A group may of course just have 1 sensor in it if required. The class also provides the functionality to start and stop the timers that are used to consider a sensor faulted. The timers would be stopped when a group moves to untrusted, and started when it goes back to the trusted state. Derived classes provide the functionality that actually determines the trust value. The constructor takes the list of sensor names that should be in the group. After the TachSensor classes have been constructed, the registerSensor(sensor) function must be called to add the sensor objects to the group. The checkTrust() function is used to calculate the trust status of the group. Change-Id: Ib4b871c6a186105028d1cc186c49611fb0608325 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* monitor: Move timer ops into TachSensorMatt Spinler2017-10-022-8/+27
| | | | | | | | | Upcoming commits will touch the TachSensor timer outside of the Fan class, and it will be cleaner to encapsulate the operations in TachSensor. Change-Id: I8584c44eb5dbe6bb93191a006d20dfc37596eeb3 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* 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 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>
OpenPOWER on IntegriCloud