summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Add stepwise controllerJames Feist2018-09-1218-212/+590
| | | | | | | | | | | | | | | This adds the ability to use stepwise curves alongside pid control. This creates a base controller class that pidcontroller and stepwise controller inherit from. Note: Hysteresis to come in follow-on patch Tested-by: Created a stepwise controller and noticed that when it crossed a threshold that it contributed to the pwm setting. Change-Id: I6cf842f80eaccafc905d620970afe91e2092d568 Signed-off-by: James Feist <james.feist@linux.intel.com>
* DbusConfiguration Flatten configurationJames Feist2018-09-121-86/+123
| | | | | | | | | | | | | It didn't make much sense to have the ILimit and OutLimit be their own interface. Entity Manager change to be submitted shortly. Tested-By: Used configuration from review https://gerrit.openbmc-project.xyz/#/c/12082/ and verified swampd still controlled fans properly. Change-Id: Id183cd09eba43f65fb80c9a4af7092f5e2e0cc08 Signed-off-by: James Feist <james.feist@linux.intel.com>
* ipmi: add back call to is_method_errorPatrick Venture2018-09-101-1/+7
| | | | | | | | Before reading the message, check if there's an error. The bus call will fail dramatically but differently than the message. Change-Id: I3ab54cc4a4590e0cf5f3eb15dcbf045a7b8bd075 Signed-off-by: Patrick Venture <venture@google.com>
* Build as c++17Patrick Venture2018-09-101-1/+1
| | | | | Change-Id: I979a1afd51cb51cc38506a12321bbc4cbab76b8c Signed-off-by: Patrick Venture <venture@google.com>
* ipmi: catch SdBusErrors on bus call failuresPatrick Venture2018-09-061-11/+13
| | | | | | | | | | Now sdbusplus call and call_noreply can throw an SdBusError exception. This code changes from checking .is_method_error() to catching the exception. Issue: 4 Change-Id: I07bbe5dbbd91d72ca75eeb14861d56aae5f3afed Signed-off-by: Patrick Venture <venture@google.com>
* clang-format: fix pointer alignment, sort usingPatrick Venture2018-09-0412-102/+102
| | | | | Change-Id: Id433d0ecc10c62807594b3a637e591045223faa6 Signed-off-by: Patrick Venture <venture@google.com>
* clang-format: always break template declarationsPatrick Venture2018-08-311-1/+1
| | | | | | | To better match the defined openbmc style. Change-Id: I27b8d9563b5b55a3b4150c1cc46caf40b482463d Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-08-3172-1295/+1227
| | | | | Change-Id: I6627b5569c2e0f730be7331403218b823a2c622f Signed-off-by: Patrick Venture <venture@google.com>
* add missing gmock header: read|write interface mockPatrick Venture2018-08-292-0/+4
| | | | | Change-Id: I8633300650d1f40d9d5b880ebee3be51236db3c5 Signed-off-by: Patrick Venture <venture@google.com>
* dbusConfiguration: restart on configuration changeJames Feist2018-08-221-0/+21
| | | | | | | | | | | | Watch for dbus interface changes and stop the daemon when they happen. Systemd should restart us if we have the correct service file written. Tested-by: Used new add object entity-manager interface and noticed daemon restart when new config was added. Change-Id: I708447dbb6ed2ab23b60036d310606ef7a1a7d3b Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add double support for sensor interfaceJames Feist2018-08-103-12/+42
| | | | | | | | | Add support for reading sensors that produce a double as the value. Use a visitor to pull out the sensor value so type doesn't matter. Change-Id: I37c05e7077ead6f3084ab9704a1b2c62becb5e19 Signed-off-by: James Feist <james.feist@linux.intel.com>
* ipmi: enable oem ipmi command for fan controlPatrick Venture2018-07-313-17/+18
| | | | | | | | | | | | This enables building the OEM IPMI handler for fan control. This includes the ability to set it in manual mode, or check if it's in fail-sade mode. Tested: Verified that using host-side tool I was able to get and set the mode for a zone, as well as check if a zone had fallen into failsade mode. Change-Id: I995407c089610692c7f6442f6e22f76689f4da1c Signed-off-by: Patrick Venture <venture@google.com>
* add fan_rpm_loop scriptPatrick Venture2018-07-252-0/+136
| | | | | | | | The script allows running different rpm set-points and verifying whether the coefficients behave as intended. Change-Id: I7bc2e5328299ee14349550edb119279c143f4a1b Signed-off-by: Patrick Venture <venture@google.com>
* Add ability to configure from dbusJames Feist2018-07-2310-1/+560
| | | | | | | | | | | | | | This allows configuration of PID control from dbus using entity manager. Sample configuration will be pushed to entity-manager repo shortly. Tested-by: Used yaml configuration and dbus / entity-manager based configuration and pid seemed to work the same. Verified printout of configuration matched generated cpp files. Change-Id: Ia7b016e53262791ffcccdb9b21c1ccddae2926bc Signed-off-by: James Feist <james.feist@linux.intel.com>
* test: dbus: dbusactivereadPatrick Venture2018-06-282-1/+56
| | | | | | | Add initial unit-tests. Change-Id: Id62894faf56a645dc44c51a173a67185ea5d9cd6 Signed-off-by: Patrick Venture <venture@google.com>
* test: dbus: passive read interfacePatrick Venture2018-06-287-7/+318
| | | | | | | | | | Added basic unit-tests and added a factory for creating the DbusPassive read interface so that it can be nicely error checked. This is handled via a valid type check where the only valid types are 'fan' and 'temp'. Change-Id: I558ed09bf509d26f20c6e431bb0789074e9aa841 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: transition to interface for testingPatrick Venture2018-06-228-39/+101
| | | | | | | | | | To make testing easier, the dbus objects now receive a helper interface to use instead of calling into a helper module. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I2521d9c75aec76e92d2e26dc044d01011e44d552 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: dbuspassive refactorPatrick Venture2018-06-221-17/+16
| | | | | | | | | Moved the sensor value handler into a sub routine to enable testing. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I4873558cfc1a48a92fb60cd173dc69e237813683 Signed-off-by: Patrick Venture <venture@google.com>
* test: pid: fancontrollerPatrick Venture2018-06-225-1/+255
| | | | | | | | | Adds unit-tests for the fancontroller. Bugfix: set point not initialized to 0, although bug has no impact. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I516833d8c9ed806b765ff9333801f3d57932a17b Signed-off-by: Patrick Venture <venture@google.com>
* test: pid: thermalcontrollerPatrick Venture2018-06-223-1/+129
| | | | | | | | | | | | Tests for the pid/thermalcontroller module. Fixes a bug where one could pass an incorrect number of inputs to the thermalcontroller. This can still be side-stepped by calling the constructor directly. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I3153ae4d907d9f90787b03e9d013d4349d911948 Signed-off-by: Patrick Venture <venture@google.com>
* test: pid: zonePatrick Venture2018-06-2213-37/+486
| | | | | | | | | | Add unit-tests for the PID zone module. Add zone_mock. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I51185b2d2daacea6ffb687e8f38c4fe2b2a1bed3 Signed-off-by: Patrick Venture <venture@google.com>
* update configure and test/Makefile.amPatrick Venture2018-06-222-7/+6
| | | | | | | | Update configure.ac and test/Makefile.am to properly handle newer googletest, per gerrit/11203. Change-Id: Idcef3d81ff834457fcdc6e0aa1be76b98c64b54c Signed-off-by: Patrick Venture <venture@google.com>
* configure.ac: add -fpic flagPatrick Venture2018-06-201-1/+1
| | | | | | | | relocation R_X86_64_32 against `.bss' can not be used when making a shared object. Change-Id: I9ca43820c9644f4b238ac44f8eaac29c4b2fd52c Signed-off-by: Patrick Venture <venture@google.com>
* util: enable unit-testsPatrick Venture2018-06-153-1/+77
| | | | | | | Start write tests and fix a missing header inclusion. Change-Id: I4e56323f972b1358dc83a4cb61c25f98cda2a479 Signed-off-by: Patrick Venture <venture@google.com>
* pid: zone split out buildersPatrick Venture2018-06-1415-257/+332
| | | | | | | | | | To enable unit-testing, split the builders into their own object files. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I92168ec9ae4946d12328e9c0b94a36bb89d0f718 Signed-off-by: Patrick Venture <venture@google.com>
* test: sensors: hostPatrick Venture2018-06-143-1/+211
| | | | | | | Tests for sensors/host Change-Id: I760825c666c711d6f9c394ceefe35f8151383785 Signed-off-by: Patrick Venture <venture@google.com>
* test: sensor_manager: add test and sensor_mockPatrick Venture2018-06-142-0/+49
| | | | | | | | | Adds a mock sensor for use in future tests, as well as adds a unit-test to sensor_manager_unittest to check that the type of a sensor added is not validated against anything. Change-Id: I684ec71c02f427cfa7a414a6a4162beaba2269da Signed-off-by: Patrick Venture <venture@google.com>
* test: sensors: pluggablePatrick Venture2018-06-142-1/+88
| | | | | | | | Tests for pluggable sensors. Pluggable sensors themselves do nothing but hold min/max values, and call into Read and Write interfaces. Change-Id: I8991d22d77172fb9b2f897c02603e5ab5747ac12 Signed-off-by: Patrick Venture <venture@google.com>
* interfaces: add equality operator for ReadReturnPatrick Venture2018-06-141-0/+4
| | | | | | | | Comparing ReadReturns where we have perfect knowledge should just use an equality operation. Change-Id: I93ee5d911e2e1f15330734031666edb2c9ef5457 Signed-off-by: Patrick Venture <venture@google.com>
* enable unit-tests: enable for SensorManagerPatrick Venture2018-06-1410-33/+80
| | | | | | | | | | | | | Enabled unit-tests in general for the project, and more specifically started with a benign construction test for the SensorManager object. Tested: Verified continues to build and link, and unit-test passes. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I4ad9a0c57efd0b9ccc37d26faa0cc1b82026b8d7 Signed-off-by: Patrick Venture <venture@google.com>
* sensors: split building from manager objectPatrick Venture2018-06-148-237/+308
| | | | | | | | | | | | To increase testability, split out the building of sensors from the sensor manager. And this further splits out building from a configuration file. Tested: Verified code continued to build and link. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: Ib63a11e1107b1864c3c370bba2bd9ef2effa42f3 Signed-off-by: Patrick Venture <venture@google.com>
* Spelling fixesGunnar Mills2018-06-146-6/+6
| | | | | | | | | 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: I1de3fdd00d0c132987b1eeb78b2945f30d3ab538 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* test: add controller_mockPatrick Venture2018-06-131-0/+18
| | | | | | | Add controller mock. Change-Id: I7341b26281571c91039f05e049cf54c50f9fccdb Signed-off-by: Patrick Venture <venture@google.com>
* test: add read and write interface mocksPatrick Venture2018-06-132-0/+25
| | | | | | | | | The pluggable sensor object receives a reader and writer interface. These are now mocked to enable some testing that involves Pluggable Sensors. Change-Id: If2d121ab47a2c044b0f3fd3465bfe45cf26c4f98 Signed-off-by: Patrick Venture <venture@google.com>
* enable unit-testsPatrick Venture2018-06-133-2/+20
| | | | | | | This CL simply enables unit-tests. Change-Id: I4ea62005566e2aa42fc29258559654fe2745f726 Signed-off-by: Patrick Venture <venture@google.com>
* sysfs: const-ify string parameters in constructorsPatrick Venture2018-06-121-2/+3
| | | | | Change-Id: I8cc427f5a99a11aaae0f18f0ddf5269e2142c33f Signed-off-by: Patrick Venture <venture@google.com>
* More on gitignorePatrick Venture2018-06-121-1/+3
| | | | | | | Added unit test logs, etc, to .gitignore. Change-Id: Iff5f70038a2de2f35015588150971eef46298088 Signed-off-by: Patrick Venture <venture@google.com>
* Update gitignorePatrick Venture2018-06-121-0/+8
| | | | | | | Add more items to clean up git. Change-Id: I5c99b15ebe21d248d0853d84a505605e1da9b9c3 Signed-off-by: Patrick Venture <venture@google.com>
* Add gitignorePatrick Venture2018-06-121-0/+26
| | | | | | | Tested: git status is cleaner. Change-Id: I3629dc8195547215d28683957397fc99da132cc1 Signed-off-by: Patrick Venture <venture@google.com>
* sensors: host: add commentPatrick Venture2018-06-111-0/+7
| | | | | | | | | Adds a comment for future clean-up where the code needs to have a parameter removed to prevent an early call to emit_object_added before the properties are properly configured. Change-Id: I18f15e933a19793597e2cd3da183f33a94e7511c Signed-off-by: Patrick Venture <venture@google.com>
* fancontroller: remove percentage log entryPatrick Venture2018-06-011-4/+0
| | | | | | | | | This log entry was just to debug something and also didn't have a corresponding header in the log file. It is no longer necessary. Tested: Ran on quanta-q71l and verified the log looked as expected. Change-Id: I4a433cf8181c7d28977bf60ca932d25a4b307c84 Signed-off-by: Patrick Venture <venture@google.com>
* pid: added thermal inputs & failsafe to loggingPatrick Venture2018-05-312-1/+16
| | | | | | | | | The tuning logging now includes the thermal inputs and whether the zone is in failsafe mode. Tested: Ran on quanta-q71l and verified the log looked correct. Change-Id: I2ee8d3128d7d969e63cb6b8728dc6698a4f54aae Signed-off-by: Patrick Venture <venture@google.com>
* Add MAINTAINERS fileAndrew Jeffery2018-05-181-0/+45
| | | | | Change-Id: I2a6680a94ba32ca278263c641205c6546fb84120 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* s/Control.FanCtrl.Mode/Control.Mode/Patrick Venture2018-05-103-5/+5
| | | | | | | | The interface for a Mode is generic enough for objects beyond strictly fan control. Change-Id: I3cb7e7564f841e680dc34743908644be9639267d Signed-off-by: Patrick Venture <venture@google.com>
* dbus: util: Remove explicit element countPatrick Venture2018-05-101-5/+1
| | | | | | | | | | The dbus interface can have new properties added, and it's improbable to have the three we care about removed. Therefore, let's remove the explicit count check on the number of properties returned. Change-Id: Ia292c73dc889a33a4b1f334585bbce910f20a580 Signed-off-by: Patrick Venture <venture@google.com>
* util: remove unused variablePatrick Venture2018-05-101-4/+0
| | | | | | | Variable became obsolete and was left in although unused. Change-Id: I2953c1eea836fb96812a8834f1776aff16b76745 Signed-off-by: Patrick Venture <venture@google.com>
* makefile: add PTHREAD libraryPatrick Venture2018-05-101-2/+2
| | | | | | | | The pthread library is added to the appropriate places during bitbake but not autotools, which hid this issue. Change-Id: I7aa250e382a447c41f9484822a1d19030d5fb872 Signed-off-by: Patrick Venture <venture@google.com>
* configure.ac: add check for libconfig++Patrick Venture2018-05-101-0/+1
| | | | | | | | Phosphor-pid-control uses libconfig++ at present for run-time configuration parsing. Therefore it should verify its presence. Change-Id: Ia5819750aa74963746461518786f1dcf6c04a556 Signed-off-by: Patrick Venture <venture@google.com>
* makefile: disable OEM IPMI libraryPatrick Venture2018-05-101-11/+11
| | | | | | | | Disable the OEM IPMI library until an OEM registration is available. Change-Id: I64f657224879eba71cec2778f6f6a6abd81cee5b Signed-off-by: Patrick Venture <venture@google.com>
* bootstrap.sh: set executablePatrick Venture2018-03-191-0/+0
| | | | | Change-Id: Ie70bda87dbc23121b0b5967a64bb1b5aa5a35ba6 Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud