summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-2615-42/+52
| | | | | | | | | 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-2611-24/+26
| | | | | | | | | | 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-268-8/+72
| | | | | | | | | | | | | | | | 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-268-10/+40
| | | | | | | | | | | 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>
* Allow removal from failsafe if timeout=0James Feist2019-02-251-19/+13
| | | | | | | | | | | | Initialize cache on start adds all sensors to failsafe. Without being able to hit the removal in updatesensors this causes the system to go into failsafe and never remove. Closes #8 Change-Id: I83f495adb1475abc27dba1734022f28d89e03d8f Signed-off-by: James Feist <james.feist@linux.intel.com>
* conf change: s/feedFwdOffOffsetCoeff/feedFwdOffsetCoeff/gPatrick Venture2019-02-205-11/+11
| | | | | | | Fixup spelling mistake for configuration field name. Change-Id: I92d0af06f4e15f4408dd10f0dd9cd71099b77f4f Signed-off-by: Patrick Venture <venture@google.com>
* DBusConfiguration: Fix scalingJames Feist2019-02-153-10/+8
| | | | | | | | | | | | Revert the removal of the /100 because that caused 90% to be passed as 90 instead of .9. To counter-act this multiply the stepwise controller by 100 so that setting 50 is 50%. Tested-by: Used sensor override to make stepwise jump threshold and got desired pwm result. Change-Id: I629bf0d4b0b3bc77660c09fccae82b1bdac4c578
* build: drop support for YAML configurationsPatrick Venture2019-02-1419-527/+107
| | | | | | | | 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>
* main: if json configuration, override yaml builtPatrick Venture2019-02-141-18/+11
| | | | | | | Override the yaml built objects if there is a configuration file. Change-Id: Id7b21fa171f5f133b2d888b4095047551b3d65b9 Signed-off-by: Patrick Venture <venture@google.com>
* main: add json configuration pathPatrick Venture2019-02-141-0/+3
| | | | | | | | If swampd is compiled to check for its configuration at run-time, it will check one specific path. Change-Id: I5c37ccbb2229db742c0f43b3d9ee0c368df19479 Signed-off-by: Patrick Venture <venture@google.com>
* build: pkg anti-pattern: use defaultsPatrick Venture2019-02-131-18/+3
| | | | | | | | Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing. Change-Id: I8db71f0c975d9c3078b1c6be7faf75667d0a223e Signed-off-by: Patrick Venture <venture@google.com>
* Convert host-ipmid -> libipmidWilliam A. Kennington III2019-02-123-7/+11
| | | | | | | | | phosphor-host-ipmid now exposes a library along with headers for interfacing with the ipmi daemon. Compile and link against the new library. Change-Id: I747c3a585d646c7ff54efb14968c8f04daafe071 Signed-off-by: William A. Kennington III <wak@google.com>
* build: check for json headerPatrick Venture2019-02-121-0/+5
| | | | | | | Check for the json header during configuration. Change-Id: I15c04b0f4892ce6498b4f171abe34a9b0944014e Signed-off-by: Patrick Venture <venture@google.com>
* swap libconfig++ for json in configuration parsingPatrick Venture2019-02-1110-404/+178
| | | | | | | Parse the configuration file as json and not libconfig++. Change-Id: Ic3e71cc810195387617b545566cf757c61c71942 Signed-off-by: Patrick Venture <venture@google.com>
* add json verification for configurationsPatrick Venture2019-02-115-1/+250
| | | | | | | | Add json verificiation for configurations. A configuration is lightly validated. Change-Id: I42361daf6ad21d3480e92c3808f5fc8ab8318e0b Signed-off-by: Patrick Venture <venture@google.com>
* errors: add configuration exceptionPatrick Venture2019-02-111-0/+16
| | | | | | | The configuration exception will be thrown for configuration errors. Change-Id: Ibf9e220826ede46a5de748e73aa328300ed01f79 Signed-off-by: Patrick Venture <venture@google.com>
* add support to build zones and PIDs from jsonPatrick Venture2019-02-115-1/+197
| | | | | | | Add support to build zones and PIDs from a json configuration file. Change-Id: If8608dcd3e084cebabb71fc39851044df4d5d7c2 Signed-off-by: Patrick Venture <venture@google.com>
* conf change: s/set-point/setpoint/Patrick Venture2019-02-1111-21/+21
| | | | | | | Remove the dash from set-point, such that it's one word: setpoint. Change-Id: I4c3033f3c2432a53d850e8f5defbe2ac1510daf8 Signed-off-by: Patrick Venture <venture@google.com>
* conf change: pid: all pid details are now camelCasePatrick Venture2019-02-1110-134/+141
| | | | | | | | Convert all PID configuration details are now camelCase instead of snake case. Change-Id: Id132053f122dfcd8abaace17df91c99758eb2b0c Signed-off-by: Patrick Venture <venture@google.com>
* sysfs: style fix on sysfswritePatrick Venture2019-02-112-8/+8
| | | | | | | Fix camelCase styling on sysfswrite. Change-Id: I6dec7f46687a1276e756687bc9669ab163b5fdc4 Signed-off-by: Patrick Venture <venture@google.com>
* conf change: sensors: read and write path renamePatrick Venture2019-02-1112-74/+74
| | | | | | | | 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-118-18/+18
| | | | | | | | | | | 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>
* pid: rename variables with full namesPatrick Venture2019-02-111-20/+21
| | | | | | | | Use full names and camelcase for the variables in the pid loop to improve readability and consistency. Change-Id: I86be69d94d3008faa497eace050d1f3b9b6a9ff4 Signed-off-by: Patrick Venture <venture@google.com>
* pid: rename structure components for stylePatrick Venture2019-02-113-46/+49
| | | | | | | Rename the struct components to camelCase. Change-Id: I0e76c4bd5aed0ec2d78edd31ddef66f852ddc71e Signed-off-by: Patrick Venture <venture@google.com>
* sensors: buildjson: add todo for failurePatrick Venture2019-02-081-0/+3
| | | | | | | | The daemon needs to validate the json configuration, either immediately after it's parsed or when objects are built from it. Change-Id: I52b5a558657ba1420bc4589de793cc496392f318 Signed-off-by: Patrick Venture <venture@google.com>
* add support to build sensors from jsonPatrick Venture2019-02-085-1/+214
| | | | | | | Add support to build sensors from a json configuration file. Change-Id: Ic5bcbcd01e085ab0d4efaed314af8dc7e82b0b9d Signed-off-by: Patrick Venture <venture@google.com>
* Move all variant usage to stdJames Feist2019-02-087-82/+71
| | | | | | | | | | 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>
* sensors: add method to grab default timeoutPatrick Venture2019-02-081-0/+14
| | | | | | | | | Add a central method for grabbing the default timeout for a sensor. This is required to allow for a configuration to leave out an unnecessary field. Change-Id: I29ecd9db67b1eb1e66e60ef49859926cf14a4542 Signed-off-by: Patrick Venture <venture@google.com>
* Add Hysteresis to pid controllersJames Feist2019-02-057-3/+142
| | | | | | | | | | | | 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>
* [dbus-configuration] Back out divide by 100James Feist2019-02-041-0/+6
| | | | | | | | | | In the entity-manager configuration files having a outlimitmax of 10000 is confusing as this looks like a tach reading, but is actually 100 percent * 100. Back this out when dealing with dbusconfiguration. Change-Id: I13609573fcf1c9da50afd270ea9aad0411b5768b Signed-off-by: James Feist <james.feist@linux.intel.com>
* README: Add margin thermal examplePatrick Venture2019-01-311-19/+24
| | | | | | | Add the details for a basic margin thermal example. Change-Id: I0a73851ba021ed727c7361c5677ae7a0b12782d0 Signed-off-by: Patrick Venture <venture@google.com>
* README: add missing verbatim wrapPatrick Venture2019-01-311-0/+2
| | | | | | | Add a missing verbatim wrap to make the "diagram" look more as-intended. Change-Id: I3f6b8c430a3b3833356e5c235c3752bf3042e5cb Signed-off-by: Patrick Venture <venture@google.com>
* README: move contents into markdown READMEPatrick Venture2019-01-312-47/+47
| | | | | | | Move the README file into the markdown README file. Change-Id: I9ddce7584fb1bc6f7cdf37b851441ced467a7dfb Signed-off-by: Patrick Venture <venture@google.com>
* README: drop TOCPatrick Venture2019-01-311-2/+0
| | | | | | | Drop TOC element as github doesn't recognize it. Change-Id: I9ba4cc6119e67d5221d15fe44bc89bed6c31a3bb Signed-off-by: Patrick Venture <venture@google.com>
* Change all default_bus back to new_system busJames Feist2019-01-296-10/+10
| | | | | | | | | | | | | | | | | 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>
* Make James Feist a MaintainerJames Feist2019-01-151-1/+1
| | | | | | | Change from Reviewer to Maintainer Change-Id: Ic28ddc8f7cc0991990e46720069ee6054d25c90c Signed-off-by: James Feist <james.feist@linux.intel.com>
* build: cleanup configure script PKG_CHECK_MODULESPatrick Venture2018-12-181-7/+39
| | | | | | | | | Cleanup the configure script package include lines. There isn't a set style for this yet, but this is an attempt to improve readability whereas it's often one long line per library. Change-Id: Ib15cb4e60c3ee047d96a75038e72539d95356f3d Signed-off-by: Patrick Venture <venture@google.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>
* test: add phosphor-logging to test makePatrick Venture2018-12-061-2/+4
| | | | | | | The tests now require phosphor-logging to be included as a library. Change-Id: Ie85d7bc9f6ff687f80064c2a499e934f7bcf2616 Signed-off-by: Patrick Venture <venture@google.com>
* build: cleanup for readabilityPatrick Venture2018-11-261-6/+28
| | | | | | | | | Cleanup a few macro definitions to make it easier to read. The changes in this patchset specifically don't touch openbmc package macros pending a change to how the CI detects openbmc packages. Change-Id: I1372f0545254a880b856a1b9b23fbbebdb4e7c65 Signed-off-by: Patrick Venture <venture@google.com>
* build: set version to 0.1 to match recipePatrick Venture2018-11-261-1/+1
| | | | | | | | Set the version specified in the configure_ac to match the recipe in meta-phosphor. Change-Id: I23092297cc5a305b4a89c7a38f656849a2a1f31f Signed-off-by: Patrick Venture <venture@google.com>
* main: drop unused headersPatrick Venture2018-11-261-2/+0
| | | | | | | | | Drop unused headers from main.cpp: - experimental/any - mutex Change-Id: I1bd0180e8582bc9c80e67bbb5e3bb5d040c218cc Signed-off-by: Patrick Venture <venture@google.com>
* build: drop commented out linePatrick Venture2018-11-161-1/+0
| | | | | | | Drop commented out line to use libmapper. Change-Id: Iaefcd8f1c0dc985f421f9df21ade545da88e807c Signed-off-by: Patrick Venture <venture@google.com>
* pid: add helper methods for thermal controller typesPatrick Venture2018-11-153-12/+32
| | | | | | | | | Add helper methods for thermal controller types, such as checking if a string is a supported thermal type and which type that string corresponds to. Change-Id: I3c782f5825e7726f264dd186df583bde0a0dc861 Signed-off-by: Patrick Venture <venture@google.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>
* Allow multiple inputs to thermal and stepwise controllersJames Feist2018-11-156-40/+127
| | | | | | | | | | | | | Use std::max to determine which input value to apply. Also start throwing when inputs are empty as otherwise there will be a nullptr dereference. Tested-by: Added multiple inputs and application no longer segfaults and verifed max was being used. Also added unit tests. Change-Id: I7c8eda45b99247b8e92e629f036c9a46c98d9fe2 Signed-off-by: James Feist <james.feist@linux.intel.com>
OpenPOWER on IntegriCloud