summaryrefslogtreecommitdiffstats
path: root/dbus/dbusconfiguration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Set ignoreDbusMinMax for StepwiseHEADmasterJames Feist2019-11-121-0/+1
| | | | | | | | | | Temperature readings should not be in percent. Add ignoreDbusMinMax as inheritFromDbus was removed. Tested: modified fan floor by changing stepwise controller Change-Id: I1bf4e15ca78bc894dc82dd68e787fd6fbd3d0aef Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add ignoreDbusMinMax to temp configurationsJames Feist2019-11-111-0/+1
| | | | | | | | | | | | | | Originally 'inheritFromDBus' was only set for fan configurations. This was removed, so now everything was inheriting from Dbus. Set the inverse of 'inheritFromDBus' of ignoreDbusMinMax to temp configurations so that they get the correct reading. Tested: Used sensor override in a loop on a sensor and saw the reading in the pid be correct Change-Id: I29dab298921f9c5204d29341555f2c5d2d011aa2 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Allow setting setpoint based on dynamic thresholdsJames Feist2019-07-161-48/+136
| | | | | | | | | | | | | | | | | As we allow dynamic thresholds in dbus-sensors to track the t-control of dimms etc, we want to be able to set a setpoint based on a offset from a threshold. This adds the ability to create a "SetPointOffset" that is a threshold of the given sensor. For instance a "SetPointOffset" of "WarningHigh" would get the sensors "WarningHigh" value then add the "SetPoint" value to it (commonly negative for WarningHigh/CriticalHigh). Tested: Turned on debug print and saw correct setpoint being loaded into config Change-Id: Idb9760ea5a66347f24573fb26937f8f278834a19 Signed-off-by: James Feist <james.feist@linux.intel.com>
* sensors: ignore min/max in json for D-Bus passive sensor readKun Yi2019-07-111-5/+0
| | | | | | | | | | | | | | | | | | | | min/max values were meant to scale write to be PWM, but were overloaded in commit 75eb769d351434547899186f73ff70ae00d7934a to scale sensor read to percent as well. However currently the D-Bus sensors built from JSON can only specify one pair of min/max values,so they cannot be used for both read/write interfaces. Fix the behavior by ignoring min/max in settings when building D-Bus passive read interface and only read them from D-Bus. Tested: D-Bus passive sensor value is no longer scaled if there is no MinValue/MaxValue specified. Resolves: openbmc/phosphor-pid-control#14 Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: I206bbe75c77e79f765eca76cfa015321dcba4aa7
* dbusconfiguration: Protect better against bad configJames Feist2019-06-241-6/+7
| | | | | | | | | | | | | | | Configurations with no input are not allowed. The current code looked for if there were any sensors avaiable. On our systems an input was not being displayed due to a bug, but the output was there, causing pid control to crash. Protect against this issue. Tested: Had sensor bug in tree, and pid control didn't segfault Change-Id: I42869748bac0b85affae5f5c671b859fec996a54 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Remove FanProfile configurationJames Feist2019-05-131-111/+42
| | | | | | | | | | | | | If we add a "Profiles" vector into the PID and Stepwise entity-manager configurations the logic becomes much more simple. We default to all profiles, and can limit the scope of some configurations to the selected profile. Tested: Switched between Acoustic/Performance mode and saw a UpperClippingCurve get added / removed. Change-Id: Ib0448b59210f696c8a28a99da06f98b065eadf08 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Make dbusconfiguration reloadable without rebootJames Feist2019-05-091-39/+73
| | | | | | | | | | | | | | | | | Now that asio is being used instead of threads, we can reload the fan configuration without having to restart the application. This moves the ownership of the passive and host bus outside of the SensorManager so that it can be recreated each reload. Tested: Watched logs and saw full fan config get reloaded after changing fan configuration Tested: Ran on json configured system and it behaved as expected. Change-Id: I00e6b27f75384fd41de2017b723f159c9691ae97 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Consolidate all util.hppJames Feist2019-05-081-1/+1
| | | | | | | | This deletes all lower level util.hpp and cats them into the top level util.hpp to avoid name conflicts. Change-Id: Ia11e4a08053a3970b0aadf21d1156ab26def36bd Signed-off-by: James Feist <james.feist@linux.intel.com>
* Bugfix: dbusconfiguration: read correct hysteresisJames Feist2019-04-021-1/+1
| | | | | | | s/positive/negative Change-Id: Ib7761abae47404706c69255fc2861d0f58c26369 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add fan profile support to dbusconfigurationJames Feist2019-02-281-6/+206
| | | | | | | | | | | | | | | | On start dbus configuration will look for profiles. If any exist it will attempt to find the thermal mode interface: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/ThermalMode.interface.yaml This can be anywhere on d-bus, tested placement was in settingsd. Based on the selected profile(s) it will create a 'whitelist' of controllers, and will remove any not in that whitelist. Tested-by: Added and removed curves based on acoustic or performance mode Change-Id: I9e83a77d71d7fcfe691cc4beb700b8a67024c64f Signed-off-by: James Feist <james.feist@linux.intel.com>
* Expand conf namespaceJames Feist2019-02-261-7/+7
| | | | | | | | | Put rest of conf.hpp in the conf namespace. This is largely a sed replace, and wrapping from_json in conf namespace as it failed to build. Change-Id: I9fe5c7b2fface44618c43af2367035afc39bcb64 Signed-off-by: James Feist <james.feist@linux.intel.com>
* s/minThermalRPM/minThermalOutputJames Feist2019-02-261-3/+3
| | | | | | | | | | The minThermalRPM is only an RPM by the fact that that is the units of the PID. As the PID units can be anything, change this to minThermalOutput to allow for different units (i.e. percent). Change-Id: Ic53fef1159ade5a413e5d519d407947f3023d8e3 Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbuspassive: allow scalingJames Feist2019-02-261-0/+5
| | | | | | | | | | | | | | | | For tachs it is beneficial to deal in percent so that multiple controllers can be used with different fan types without having to recalculate. This starts using the unused min and max fields to be able to scale readings. Since max and min are commonly on the value interface, the special value of <int64_t>::lowest() allows these to be gathered from dbus instead of having to enter them manually. Tested-by: Moved pid control to percent and printed outputs Change-Id: I9496eb92a18b68a7cd7f034d41d40ef5175c6974 Signed-off-by: James Feist <james.feist@linux.intel.com>
* stepwise: Add ceiling typeJames Feist2019-02-261-0/+3
| | | | | | | | | | | Add a stepwise ceiling type, this is used as a upper clipping curve to limit the max output based on a temperature sensor. This is commonly used for quiet fan mode where CPU throttling is allowed to preserve a max fan noise. Change-Id: I181d5913c92e5498a34e6d3f67cf99b67471479c Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbusconfiguration: set timeout to 0James Feist2019-02-251-2/+2
| | | | | | | | | | Setting this value to zero so we can limit d-bus traffic and not send updates unless there is one. Tested-by: fan control worked normally after Change-Id: Ie8bd7fbfd86c1643ea5bf76cf49a087923db0ccf Signed-off-by: James Feist <james.feist@linux.intel.com>
* build: drop support for YAML configurationsPatrick Venture2019-02-141-3/+3
| | | | | | | | phosphor-pid-control now only supports json configurations and no longer builds from a YAML configuration. Change-Id: I25fa7766399a1345dca89aac20e7b49caa46797e Signed-off-by: Patrick Venture <venture@google.com>
* conf change: pid: all pid details are now camelCasePatrick Venture2019-02-111-26/+31
| | | | | | | | Convert all PID configuration details are now camelCase instead of snake case. Change-Id: Id132053f122dfcd8abaace17df91c99758eb2b0c Signed-off-by: Patrick Venture <venture@google.com>
* conf change: sensors: read and write path renamePatrick Venture2019-02-111-5/+5
| | | | | | | | Rename the readpath and writepath for camelcase styling to make all configuration variables consistent. Change-Id: I33f475075c8f40cd2029a5c0bfda950846cd5d44 Signed-off-by: Patrick Venture <venture@google.com>
* conf change: rename zone variablesPatrick Venture2019-02-111-4/+4
| | | | | | | | | | | Rename the zone variables to make them camelCase as a step towards making all configuration variables camelCase for consistency. Note: This patchset requires a change to your yaml configuration if you're using it, or libconfig if you're using it. Change-Id: If9cf1d7eb8227d305a1625275f2f7082c0d6905a Signed-off-by: Patrick Venture <venture@google.com>
* Move all variant usage to stdJames Feist2019-02-081-54/+47
| | | | | | | | | | This just a style change, remove variant_ns in favor of std. Tested-by: it built Change-Id: Id5a075e8b73a7724cbc5153fb7dfcf369e79c483 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add Hysteresis to pid controllersJames Feist2019-02-051-0/+18
| | | | | | | | | | | | Add hysteresis to pid controllers to lower pwm changes. It is defaulted to 0 so it should be transparent to any controller that choses not to implement it. This is the same pattern used by the stepwise controller. Tested-by: Unit tests passed Change-Id: Ib47114285b0017258b7f77eaf067d310f95a0c60 Signed-off-by: James Feist <james.feist@linux.intel.com>
* [dbus-configuration] Add regex supportJames Feist2019-02-051-40/+59
| | | | | | | | | | | | | | | | | | Add regex support to sensors when defining PIDs so that we don't have to type all elements of a single type, for instance all Cores of a CPU. Tested-by: Added a configuration with inputs "Inputs": [ "Core \\d+ CPU0" ], And saw all Cores added when debug printing was turned on. Change-Id: I21c60d1cfc83b12aaa12039f09227f22f2b1d2b9 Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbusconfiguration: Change apply_visitor to visitJames Feist2018-12-061-23/+21
| | | | | | | | | | New sdbusplus changes remove apply_visitor. Tested-by: Manually checked out latest sdbusplus and made sure it built. Change-Id: I4418cf29339c61df7a172c1b44a6347b5f20a6ea Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbusconfiguration: Fix and simplify zone calculationJames Feist2018-11-161-34/+17
| | | | | | | | | | | | This code was duplicated throughout the file and the index calculation was wrong as .size() gave us greater than the last index. Tested-by: Added two zones and set DEBUG = true to notice all pids in the correct zone. Change-Id: I8eaff89ffcbd75e68abca1e79ab9cfd67db0c03c Signed-off-by: James Feist <james.feist@linux.intel.com>
* Move all floats to doublesPatrick Venture2018-11-111-17/+17
| | | | | | | | | The code was developed initially around a pid loop implemented using floats. Therefore, the code was converting back and forth between double for sensor values as inputs and outputs from this PID loop. Change-Id: I2d2919e1165103040729c9f16bb84fde3dd6b81b Signed-off-by: Patrick Venture <venture@google.com>
* dbusconfiguration: Protect against partial configJames Feist2018-11-011-1/+1
| | | | | | | | | | | | A zone details config is also required along with a zone configuration or we'll end up crashing. Check for both. Tested-by: Removed Zone Details Config and daemon halted correctly. Change-Id: Icf3775eb4130fcf2683e12b272fb2051b0eb809f Signed-off-by: James Feist <james.feist@linux.intel.com>
* cleanup: drop obsolete is_method_error checksPatrick Venture2018-10-311-9/+0
| | | | | | | is_method_error is obsolete from sdbusplus. Change-Id: Ia3fb76dd2f4a14eca51b3cfbcd50427b36d946b3 Signed-off-by: Patrick Venture <venture@google.com>
* style: rename main globals per stylePatrick Venture2018-10-301-13/+13
| | | | | | | Rename the main global variables per openbmc style. Change-Id: I9de8cf841304f24238ae0275b6904f4926a6892d Signed-off-by: Patrick Venture <venture@google.com>
* style: fixup naming of structuresPatrick Venture2018-10-301-4/+4
| | | | | | | Fixup naming of structures to UpperCamel. Change-Id: I6a9bf0b954298089c85d3362e86cd95b3fc5b944 Signed-off-by: Patrick Venture <venture@google.com>
* dbusconfiguration: lower cpu cycles while waitingJames Feist2018-10-291-0/+1
| | | | | | | | | | Put in a wait() Tested-by: Ran on a system without config, noticed lower cpu cycles Change-Id: I7e59db2bd2f7d7a8fd8695a6277dfed1a86b8ab3 Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbusconfiguration: Fix mapper callJames Feist2018-10-251-1/+1
| | | | | | | | | | Our downstream version of the cpp mapper allowed an empty path for GetSubTree, change this to root "/". Tested-by: Configuration loads with both mappers Change-Id: I206d2deaf9bb54acda15eccb778633f10398098a Signed-off-by: James Feist <james.feist@linux.intel.com>
* cleanup: apply constness to read-only iteratorsPatrick Venture2018-10-231-5/+5
| | | | | | | Apply const to read-only iterators to indicate intent more clearly. Change-Id: Ic14304c69361da203d3d3a900180bd54346acc87 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: set inclusion to local-first searchPatrick Venture2018-10-141-2/+3
| | | | | | | Use local-first search for local headers. Change-Id: Ib9094836c6b2932804d0d46ca8eaad0e1e4259e4 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: transition to find_ifPatrick Venture2018-10-131-6/+9
| | | | | | | | [dbus/dbusconfiguration.cpp:58]: (style) Consider using std::find_if algorithm instead of a raw loop. Change-Id: I6fdabecc027addfc6f843a4b5f4621a61db39c2d Signed-off-by: Patrick Venture <venture@google.com>
* Stop using mapbox namespace directlyJames Feist2018-10-111-17/+17
| | | | | | | | | | | sdbusplus is transitioning to std::variant, the sdbusplus::message::variant_ns will be changed to std and should move over correctly, but mapbox will be deleted. Tested-by: It built Change-Id: I25672cef16a6c75ae2f3619d319ade1eb063a98b Signed-off-by: James Feist <james.feist@linux.intel.com>
* [dbusconfiguration] Allow partial configurationsJames Feist2018-10-061-99/+124
| | | | | | | | | | | | | | | In a few cases (cpu sensors, etc.) we can add sensor during runtime, that aren't an error to be missing when the system is off, or are optional (add-in cards). Add a dbus match to restart on sensors added, and don't add configurations that are missing a sensor. Tested-by: Turned on debug, noticed on cpu sensors being added daemon restarted correctly. Also noticed daemon didn't crash with no configuration. Change-Id: Ide0bd03c12e380e5aad56b1da06e34a5fc5cdb9f Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add hysteresis to stepwise controllerJames Feist2018-09-211-0/+16
| | | | | | | | Tested-by: Ran on platform monitoring output and wrote unit test Change-Id: I74a1d21544c1a9cb4c1cb26dd4a353cbff0442d0 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add stepwise controllerJames Feist2018-09-121-133/+252
| | | | | | | | | | | | | | | 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>
* clang-format: fix pointer alignment, sort usingPatrick Venture2018-09-041-37/+37
| | | | | Change-Id: Id433d0ecc10c62807594b3a637e591045223faa6 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 ability to configure from dbusJames Feist2018-07-231-0/+341
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>
OpenPOWER on IntegriCloud