summaryrefslogtreecommitdiffstats
path: root/dbus
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>
* conf: add ignoreDbusMinMax optionPatrick Venture2019-09-101-0/+7
| | | | | | | | | Add an optional field to the sensor configuration, s.t. it'll tell a dbus passive sensor to ignore the MinValue and MaxValue properties from dbus. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ia6a8c802c2dc5bf41e5e860b21d7764cc09e6b6b
* 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-112-14/+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
* util: Avoid division by invalid valueKun Yi2019-07-101-1/+1
| | | | | | | Check for max > min before dividing by difference Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: Ic2a983bb6f7c04f1deafcab228b76ff60012f011
* dbuspassive: Fix typo in variable checkKun Yi2019-07-101-1/+1
| | | | | | | When setting min, should check for min instead of max. Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: I0097bb329408f807fea6d68ca0055c5d8215aba3
* 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>
* Add Fan Redundancy SupportJames Feist2019-06-054-11/+252
| | | | | | | | | | | | | | This adds fan redundancy support to passive sensors. If there are redundancy interfaces on dbus, we'll fail a sensor if the status is set to failed. Tested: Set Redundancy to Failed On Dbus, saw all fans in collection boost. Then restarted swampd, came up and still boosted. Set redundancy OK, and they all slowed down. Change-Id: I8879bef1471bbc168435d6b22dd20006b9dca133 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-092-40/+74
| | | | | | | | | | | | | | | | | 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-088-114/+8
| | | | | | | | 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-263-9/+9
| | | | | | | | | 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-265-4/+60
| | | | | | | | | | | | | | | | 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-084-77/+63
| | | | | | | | | | 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>
* Change all default_bus back to new_system busJames Feist2019-01-292-3/+3
| | | | | | | | | | | | | | | | | new_default now returns a reference to a single bus, phosphor-pid-control uses multiple busses so we do not want that. This was the way it was implemented prior to https://github.com/openbmc/sdbusplus/commit/8ca6025eed193c252149b2908c3d5e37b00b0107 Tested-by: swampd ran normally These errors go away: Jan 28 18:28:45 swampd[1760]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Jan 28 18:28:45 swampd[1760]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.InconsistentMessage: Bad message Change-Id: I708cd5e6c45509f27d4fe783c0b0cfb52ff10336 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Remove singleton from dbuswriterJames Feist2019-01-151-22/+8
| | | | | | | | | | | | | | | | | When you create multiple zones, they are added to multiple threads. Doing so causes multiple threads to access the single bus object, which is illegal in sd_bus and occasionally causes a crash on start like the below. Assertion 'IN_SET(bus->state, BUS_RUNNING, BUS_HELLO)' failed at ../git/src/libsystemd/sd-bus/sd-bus.c:1720, function dispatch_wqueue(). Aborting. Aborted (core dumped) Tested-by: Started swampd multiple times and crash went away. Change-Id: Ic44b93e51ecf3d39cd8b846bb3003516cdaf7816 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>
* std::variant: Fixup apply_visitor callsWilliam A. Kennington III2018-11-122-2/+2
| | | | | | | | These should be std::visit compatible instead of the custom mapbox apply_visitor. Change-Id: I32098c02bda5a3699abace919426a6e4b9c8ae9c Signed-off-by: William A. Kennington III <wak@google.com>
* Move all floats to doublesPatrick Venture2018-11-113-39/+22
| | | | | | | | | 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-312-13/+1
| | | | | | | 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>
* dbus: dbuswrite: add try/catch block on callsPatrick Venture2018-10-301-6/+23
| | | | | | | | The dbus calls can now except, therefore add try/catch blocks and report the errors. Change-Id: I8cae2576922fa9316065ef048e674beb48a58e88 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: dbuswrite: use factory to catch errorsPatrick Venture2018-10-302-12/+55
| | | | | | | | Add factories for creating DbusWrite and DbusWritePercent objects and use these factories. Change-Id: Iad222d4bf6c1fdf561daa4ba9d88a6644c0a5965 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: passive: move exception checking into factoryPatrick Venture2018-10-303-15/+31
| | | | | | | | Move the exception checking into the factory to remove possibility of exception during construction. Change-Id: I22922f23247c0579ee2a3411b5c8cede44fe324c Signed-off-by: Patrick Venture <venture@google.com>
* dbus: util: add missing try/catch blockPatrick Venture2018-10-301-6/+11
| | | | | | | Add missing try/catch block to getProperties. Change-Id: Ie1f08f496dc529432df620879416e8bddb2e7d5c Signed-off-by: Patrick Venture <venture@google.com>
* style: function names should be lower camelPatrick Venture2018-10-304-15/+15
| | | | | | | Fix function names to be lower camel. Change-Id: I145e1f4c03d7740bc1525dcffbdce2f78fd61075 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: util: add missing try/catch blockPatrick Venture2018-10-303-6/+19
| | | | | | | Add try/catch block around ObjectMapper call failures. Change-Id: I5a2a7a8c1049ea16cebe8b87a509bf5104e432ab Signed-off-by: Patrick Venture <venture@google.com>
* style: member functions should be lower camelPatrick Venture2018-10-306-19/+19
| | | | | | | Rename member functions to be lower camel instead of snake case. Change-Id: Ib227fd3dadb6d9607290277205223a4324cd4ce5 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-passive] Add threshold fan failureJames Feist2018-10-154-2/+111
| | | | | | | | | | | | | | When a threshold is crossed for a monitored sensor, assert fan failure. Tested-by: Changed a sensor threshold so that its current reading made the threshold asserted and noticed via print messages that the sensor went into failure state. Also noticed fans ramp. Wrote unit test to verify sensor can move in and out of error state correctly. Change-Id: I83182536e4874eaba97f3f1d48d53ac110fba833 Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbus: set inclusion to local-first searchPatrick Venture2018-10-142-4/+6
| | | | | | | 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-113-21/+21
| | | | | | | | | | | 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>
OpenPOWER on IntegriCloud