summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Verify mode provided is supportedMatthew Barth2019-02-181-1/+11
| | | | | | | | | | | Before updating the current mode, verify that the mode provided by the end-user is in the list of modes that are supported. Tested: Only supported modes can be set as the current mode Change-Id: Ie21839b6bf7245756fedf417e143c28bc9da32f1 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Initially use default current mode upon restoringMatthew Barth2019-02-181-2/+2
| | | | | | | | | | | | | | | | When restoring the persisted current mode, initially set the current mode to what's already provided. When no interface is defined within the zone yaml, a default value of "Default" is already set on the Control.ThermalMode interface. If an interface is provided on the zone yaml, and the Current property is initialized to a value, use this value initially upon restoring. During the restore, this value could change to what was persisted. Tested: Current mode is set correctly upon initialization & restore Change-Id: I0fae247303903d85e95fc044c96fc1809df2fa03 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Current mode set as uppercaseMatthew Barth2019-02-181-3/+6
| | | | | | | | | | | | Always set the current thermal control mode in uppercase to handle case insensitive modes given since it would be something possibly set by the end-user. Tested: Current mode always set in uppercase Change-Id: Ie159de24f5f9b4dd5651a9411f7b176501c4846a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Fix: srcrev bump 4b258ac8b6..7883f58ab2Matthew Barth2019-02-181-0/+1
| | | | | | | | | | Add missed python variable initialization causing srcrev bump fail Failed srcrev bump: https://gerrit.openbmc-project.xyz/18414 Change-Id: I0d7d4647abe3c2f46cabfebf6be5ab500641f504 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Parse and generate zone interfacesMatthew Barth2019-02-142-0/+187
| | | | | | | | | | Interfaces can optionally be defined on each zone to include setting properties under those interfaces when fan control initializes the zone. Setting the property values here allows them to be initialized to a default value or set of values. Change-Id: I75d51a05caa9e5662a0608d285fd388acc8593e2 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add framework to set properties on a zoneMatthew Barth2019-02-144-2/+44
| | | | | | | | | | | Properties hosted by a zone object need the ability to be set upon zone initialization. This adds support to allow the zone configuration yaml to contain what properties to set and with what values on a zone. The parser updates to generate what uses this framework is in a followup commit. Change-Id: I9fd93746cc097f05869400451daff03cf3ef89b7 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* build: pkg anti-pattern: use defaultsPatrick Venture2019-02-131-12/+6
| | | | | | | | Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing. Change-Id: Id750ce7c0fb89f94c0da53868f695ac161475674 Signed-off-by: Patrick Venture <venture@google.com>
* Use zone object's path attributeMatthew Barth2019-02-131-7/+2
| | | | | | | | A zone's object path is set when the zone is created and available to be used instead of determining the zone's object path each time. Change-Id: Iddfebd1545bb49054d95f8c19a71b2fbf9c2f592 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Update parser for properties on zone objectsMatthew Barth2019-02-133-14/+34
| | | | | | | | | | | | | | | | Create a service attribute that can be optionally defined on a group denoting what service is hosting the group members. Initially, defining a service name generates the group member(s) to be zone objects only. This service attribute will be enhanced to specifically note what service provides the group members and allow for a better trigger for properties on zone objects instead of generating a blank signal match. Tested: Blank signal match generated for group members in events used Change-Id: I483fcf6a5e210e5d70bc9d5c4c0dee15524b01b9 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Trigger current mode property change eventsMatthew Barth2019-02-131-1/+11
| | | | | | | | | | | | | | Each time the current mode property changes, handle the event similarly to other event signal triggers substituting with a null message. When the handler receives a null message, the property's value that triggered the event is retrieved whether from the zone object or from dbus. Tested: Triggered the use of alternative events based on thermal control mode property state Change-Id: Ibc663c3721c331393250bd32bda0d45cf0214f12 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Store and access zone object propertiesMatthew Barth2019-02-133-8/+99
| | | | | | | | | | | | | | | | | | 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-132-0/+21
| | | | | | | 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-132-1/+35
| | | | | | | | | | 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-133-0/+29
| | | | | | | | 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-135-5/+43
| | | | | | | | | | | | | 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>
* Fan control dbus busname and object pathMatthew Barth2019-02-052-0/+15
| | | | | | | | | | | | Add fan control's default dbus busname and object path to use or what's provided thru configure. The fan control manager requests the busname after all the zones are created. Tested: Found the requested busname for a zone in the busctl list Change-Id: I8ee1e9e4094dcec958e8ae81ad4299357b8f792d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* libfan: RemoveWilliam A. Kennington III2019-02-056-45/+0
| | | | | | | | | | | | | Since the removal of the custom timer implementation our libfan has nothing but a single header file. Since we have no object code left we do not need a library to contain this code since the header is directly included where needed. Tested: Built and run through unit tests. Change-Id: I139b83ab979ead88cfd4c180ba8847a29c6407e2 Signed-off-by: William A. Kennington III <wak@google.com>
* Remove timer in favor of sdeventplus/utility/timerWilliam A. Kennington III2019-02-0514-780/+45
| | | | | | | | | | | 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>
* Parser updates to support alternate events actionMatthew Barth2019-01-251-4/+94
| | | | | | | | | | | | | | | With the use alternate events action, the ability to generate an event type is required within the parser. This action requires two separate lists of events to be generated and to generate the event code, it was necessary to add what code is generated for each section that comprises an event to the parser directly. Tested: Updated events yaml with an event to use the alternate events action Verified the generated code builds and runs on wspoon Change-Id: I2078610222b0ae0f7fdbcf348e5c9ff02c4108b6 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add alternate events actionMatthew Barth2019-01-251-0/+72
| | | | | | | | | | | | | | | | | | | The alternate events action uses a group of properties to determine whether a default set of events should be used or an alternate set of events should be used. When any of the members of the group do not match the given property state, the default set of events are used. Once all members of the group match the given state, the alternate set of events are used. Each time the events used are to change, the current set of events are removed prior to loading the replacement set of events. Tested: Used the 'WaterCooled' property to trigger using the default or alternate floor speed events. Verified fan control memory usage doesnt grow by doing multiple event switching. Change-Id: Ib8a4b835bf370894c572ccfa8fdc5a4479ef570f Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* control: manager: Avoid the need for fconceptsBrad Bishop2018-11-281-1/+1
| | | | | | | | | | | Use of auto in a function parameter list is supported in c++17 but gcc8 requires enabling concepts TS support. We don't require a template anyway - just be explicit here and avoid the need for -fconcepts until such a time that other concepts TS features are required. Change-Id: Iec6205a2e4da41aeb5840dd9942778ba0f373842 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* std::variant: Apply missing fixupWilliam A. Kennington III2018-11-271-2/+4
| | | | | | | | This code is not compiled during the unit test run. The issue was noticed trying to integrate into a real openbmc build. Change-Id: I30b7afaf722b1a14e5ac3d5e93e13b59db48be7a 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>
* control: Add interface when not in service cacheMatthew Barth2018-11-091-2/+7
| | | | | | | | | | | | | | | | | | When a service is cached, each interface it hosts is added to a list. In the case where an object path given to fan control is never found, a service lookup is performed on this path causing its given interface to be added. This fixes that interface from continuously being added in the case that the object path is attempted to be accessed continuously from dbus. Resolves openbmc/phosphor-fan-presence#12 Tested: Added & removed events containing object paths that dont exist, interface list remains the same size. Change-Id: Id034e7829566979c196cb9901cbea287ddab78d4 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Fix std::variant usageWilliam A. Kennington III2018-11-061-2/+2
| | | | | | | | We need to use the std::get() interface instead of the mapbox .get() member interface for variant compatibility. Change-Id: I6c7843ea0cb765332457273867b5df6b78ca72a2 Signed-off-by: William A. Kennington III <wak@google.com>
* Rebase correction (timerPos -> timerConfPos)Matthew Barth2018-11-061-1/+1
| | | | | Change-Id: I5ab5adcc22f044b3cf0955082061c67f2a281307 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* control/zone: Use const references when iteratingWilliam A. Kennington III2018-11-061-1/+1
| | | | | | | | | | | We don't want to copy the object out of the container we are iterating over. Tested: Built and run through unit tests. Change-Id: I68b041f98e1c6a6a9dbc59448b629e1d22ba62c9 Signed-off-by: William A. Kennington III <wak@google.com>
* Remove all signals when an event is removedMatthew Barth2018-11-062-37/+93
| | | | | | | | | | | | | | 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>
* Prefer bind over method call in lambdaWilliam A. Kennington III2018-11-052-3/+5
| | | | | | | | | | | | | This reduces a layer of indirection since the function can be called directly instead of indirectly accessing it with the lambda. It also makes the instantiation more flexible since it can match callbacks with extra arguments. Tested: Built and run through unit tests. Change-Id: I5317203fa70c027c5e774ed6192952058e35bd81 Signed-off-by: William A. Kennington III <wak@google.com>
* control/zone: Reference instead of copying timer dataWilliam A. Kennington III2018-11-052-3/+8
| | | | | | | | 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-053-55/+33
| | | | | | | | | | | | 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>
* control: Rename Timer -> TimerConfWilliam A. Kennington III2018-10-317-13/+14
| | | | | | | | | | | | It is confusing to read some of the type definitions that deal with timers when Timer could mean a timer instantiation or a set of timer configuration parameters. This change disambiguates the two types. Tested: Built and run through unit tests. Change-Id: I9dd6b47886747d56a86b6a50eb9a74a331d0a1fe Signed-off-by: William A. Kennington III <wak@google.com>
* control: Alias TimerType locallyWilliam A. Kennington III2018-10-313-8/+7
| | | | | | | | | | | This is needed for a future commit that removes the local phosphor::util::Timer implementation. Tested: Built and run through unit tests. Change-Id: I8ea3399fec8761055d4a0d94fb9ea91fd34040ea Signed-off-by: William A. Kennington III <wak@google.com>
* Switch sd_event loops to sdeventplusWilliam A. Kennington III2018-10-2924-166/+99
| | | | | | | | | 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>
* gitignore: add libtoolPatrick Venture2018-10-241-0/+2
| | | | | | | Add libtool artifact to gitignore. Change-Id: Ie283f97cc0d714be89ebed420f439322cda653b1 Signed-off-by: Patrick Venture <venture@google.com>
* Fix exit status codesWilliam A. Kennington III2018-10-199-20/+18
| | | | | | | | | | Using an exit status of -1 everywhere leads to the status being converted to 255 when output to a calling application. While this does signify an error it has a reserved meaning for exit status out of range. Lets use a valid general exit status of 1 instead. Change-Id: I326701c78985e34c430c258fe31d9e910da10405 Signed-off-by: William A. Kennington III <wak@google.com>
* Makefile: Fix library compile flagsWilliam A. Kennington III2018-10-191-0/+4
| | | | | | | | We are missing flags for compiling against dependencies used in libfan. Change-Id: I62addac0d153be194171acee77ec7a32a503b85c Signed-off-by: William A. Kennington III <wak@google.com>
* phosphor-fan-presence: use c++17Vernon Mauery2018-10-041-1/+1
| | | | | | | Update configure.ac to choose the c++17 standard Change-Id: I9c7bba8ae28101e95eb969dd1d1ae01f37cd3e48 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Fix libfan_la_CXXFLAGSLei YU2018-09-262-1/+5
| | | | | | | | | | | | | The libfan_la_CXXFLAGS was incorrectly defined as empty by a typo, fix it. Then specify gcc-ar gcc-ranlib for link time optimization, otherwise the static library will get link error. Tested: Verify the build is OK in CI, local build, and SDK build. Resolves openbmc/phosphor-fan-presence#11 Change-Id: I17c83b9927a796f8928a71688c1640d1a602a108 Signed-off-by: Lei YU <mine260309@gmail.com>
* Add -flto to CXXFLAGSAndrew Geissler2018-08-275-5/+9
| | | | | | | | | | Per openbmc/openbmc#3364, adding -flto to CXX flags in order to reduce overall library and binary sizes. Ref: https://gcc.gnu.org/wiki/LinkTimeOptimization Change-Id: I3ee31a15fc0ded4308aa9d00a11b41bc62eb9799 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Handle SdBusError exceptionsMatthew Barth2018-07-173-13/+35
| | | | | | | | | | When the SdBusError exception was added, all sdbusplus::bus::call function use required this exception be handled appropriately in each case where it could occur. These changes are the result of handling the possibility of this exception correctly within the fan applications. Change-Id: I6ecef3008412b299a4fedbb13716f656cfbf1a90 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Use s.c_str() in log messagesJoseph Reynolds2018-05-301-2/+2
| | | | | | | | | Partly resolves openbmc/openbmc 2905 Tested: static_assert only Change-Id: I0cabc8d84c763af924d067880417c9a11bcfde58 Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Add MAINTAINERS fileAndrew Jeffery2018-05-211-0/+46
| | | | | Change-Id: Iee7a92941638d2b147eef2f0e85f9c90f638003c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* utility: Remove getService functionMatthew Barth2018-05-172-59/+1
| | | | | | | | | | The getService function is no longer used and is not necessary with the getService function within sdbusplus.hpp Tested: N/A Change-Id: Ifad8ec1efb64508923d4f5c42bef318f0b03124c Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* utility: Remove getInvService functionMatthew Barth2018-05-172-14/+0
| | | | | | | | | | The getInvService function is no longer used and is not necessary with the getService function within sdbusplus.hpp Tested: N/A Change-Id: Ibb2d55ef5be1852ae8ebd3dac32d66518d5d705c Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* cooling-type: Use lookupAndCallMethodMatthew Barth2018-05-173-21/+18
| | | | | | | | | | | | | Have phosphor-cooling-type fail with a DBusMethodError exception when a failure occurs on updating inventory. Resolves: openbmc/openbmc#2628 Tested: Cooling type properties still set correctly Change-Id: Ia7e3379fc7d75c70e9c71d4f940f9da84b9f5774 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Use setProperty function in fan set speedMatthew Barth2018-05-171-25/+8
| | | | | | | | | | | | | | | | When a fan's target speed is set, using the setProperty function allows for better handling of dbus failures setting the fan target property. If a failure occurs setting this property, a journal entry is created and a DBusPropertyError exception is thrown to allow the fan control application to exit and restart quickly in its allowed attempts configured in systemd. Tested: Fan control application logs an error to the journal and then terminates when a dbus error occurs setting a fan target speed. Change-Id: Ibd4bd8b18b6010727831d97e32c14fd6c681e170 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Throw DBusPropertyError for all property accessesMatthew Barth2018-05-172-7/+100
| | | | | | | | | | | | | On all get/set property functions, when an error occurs performing the access of a property, throw a DBusPropertyError exception containing the identifying parameters of the property. Tested: DBusPropertyError exception occurs on failing to set a property DBusPropertyError exception occurs on failing to get a property Change-Id: I9882d62d75153b4320a8d4a21ba7a52efbdd0af2 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add set property functions without mapper lookupMatthew Barth2018-05-171-0/+44
| | | | | | | | Tested: Property set with provided service name Change-Id: I158d33f85602f48d1dfe8baa7ce54eec6e8f8296 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Call method and return functionMatthew Barth2018-05-171-0/+21
| | | | | | | | | | | | Add a function that calls a method and returns the response message without checking for an error. Its up to the user of this function to check if response.is_method_error() exists and handle accordingly. Tested: Method is called and raw response is returned Change-Id: I6678a78d8cfb32d2d13dba7cb48719fd26eccebc Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud