summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sdbusplus: Add PropertiesChanged type aliasBrad Bishop2017-07-181-0/+4
| | | | | | | | Add an alias to cut down on typing when using properties changed signal callbacks. Change-Id: I494d58006cbc136fc2f1d9395039a4535922f35e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* monitor: Avoid Target interface for mapper queriesBrad Bishop2017-07-111-1/+3
| | | | | | | Avoid asking the mapper for the Target interface on sensors that do not have it. Change-Id: I43f61c98291cc15d7daf43d2b01c6b7fa4edfa62
* presence: Check DBus for initial stateBrad Bishop2017-07-081-5/+38
| | | | | | | | At startup load the initial state from the DBus object if one exists already. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ia4ad2f3c2b5c521406d9a186113b11cf8ed69b14
* presence: Add initialstate ctor argumentsBrad Bishop2017-07-083-9/+14
| | | | | | | | Allow class users to set the initial state of enclosures and tach sensors. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: If5199361ab051ca46096f66ba925aeb1a874801f
* presence: Remove work from enclosure constructorBrad Bishop2017-07-082-2/+2
| | | | | | | | Allow class users to control when an enclosure should export its state on DBus. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I64bc2d85b7a072e9ec539330640f766961724b17
* presence: Use new sdbusplus wrapperBrad Bishop2017-07-084-42/+19
| | | | | | | Use the sdbusplus wrapper methods introduced previously. Change-Id: Ifd431753e9513436a9b5ab98cc49d907a5929c20 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add sdbusplus wrapperBrad Bishop2017-07-081-0/+195
| | | | | | | | Facilitate mocking. Avoid sdbusplus::bus::bus reference proliferation. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I0a55fa178a96af4fd63f249cde0a129b7007731f
* 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-2816-75/+111
| | | | | | | | 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>
* Include zone conditions when generating fan defsGunnar Mills2017-06-261-0/+7
| | | | | Change-Id: I1eb063a584e935d48bd5d314dea777a53417c83b Signed-off-by: Gunnar Mills <gmills@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>
* Add sdevent C++ wrappersBrad Bishop2017-06-262-0/+223
| | | | | | | Lifted from phosphor-dbus-monitor. Change-Id: I1d59e39c87d9019d66526398ba1048281dba5c9b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Update to use match methods for signal callbacksMatthew Barth2017-06-262-46/+20
| | | | | | | | | | | Attach the tach change handler function to the match along with using the new match methods on the match string. Add 'argN' sensor value interface to reduce dbus traffic Resolves openbmc/phosphor-fan-presence#5 Change-Id: I9c809e42a384ea751d2f3a51b14ad304ce61cd2c Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* fan-monitor: use sd_notify(READY=1)Matt Spinler2017-06-262-0/+12
| | | | | | | | | | | | | After the fans have initialized their Functional inventory property, send systemd the READY notification. If the service which runs this application is of type = notify, then systemd will hold off starting any dependent services until this is sent. In our case, we want phosphor-fan-control --control to not be started until this notification is done. Change-Id: Iec87418ce308aa9ca81a47c20039ade7e8fe66c3 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Update gitignoreBrad Bishop2017-06-152-0/+4
| | | | | | | | | Add VIM swap files. Add testcase data and log files. Add testcase binary. Change-Id: I0bc59b9d74c157556e95ce0cc41974c9c42335e0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: build: Add yaml file to generated depsBrad Bishop2017-06-133-18/+5
| | | | | | | | Makefile updates such that updates to the YAML file result in a retrigger of the python script. Change-Id: I83b637f71dc380a56be0fd40390176d3b201b29a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Update gitignoreBrad Bishop2017-06-081-0/+1
| | | | | | | Ignore test-driver Change-Id: Id2dfa273021f0ea67835b2d2c3a22d00f835c2ab Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.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-312-2/+63
| | | | | | | | 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>
* Add property changed signal handlerMatthew Barth2017-05-315-1/+247
| | | | | | | | Enable the control application to handle property changed signals to set or update a cached set of these properties Change-Id: Ib84ffe1e801ee7dd85d17fdbb122d124d307dbd3 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Have cooling-type use the common argument.hppMatt Spinler2017-05-245-44/+6
| | | | | | | | | | | | The cooling-type application should use the common header file for the ArgumentParser class now that one is available. Also fixed where a static ArgumentParser constant was being initialized. Change-Id: I1fb0dfe3bd0c6e0200ad7c718ef2a3def5476f3f Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Change example/zones.yaml to full_speedGunnar Mills2017-05-241-3/+3
| | | | | | | initial_speed should be full_speed in example/zones.yaml Change-Id: I64b4803a26006cf78f6d29859bb8dd43a5cf63b3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Implement changes to read GPIO device for cooling type.Brandon Wyman2017-05-227-62/+126
| | | | | Change-Id: If40a54510fb05d67ee0bfdf24026c1d7470897ca Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
OpenPOWER on IntegriCloud