| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Check for max > min before dividing by difference
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: Ic2a983bb6f7c04f1deafcab228b76ff60012f011
|
|
|
|
|
|
|
| |
When setting min, should check for min instead of max.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I0097bb329408f807fea6d68ca0055c5d8215aba3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
s/positive/negative
Change-Id: Ib7761abae47404706c69255fc2861d0f58c26369
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Convert all PID configuration details are now camelCase instead of snake
case.
Change-Id: Id132053f122dfcd8abaace17df91c99758eb2b0c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
is_method_error is obsolete from sdbusplus.
Change-Id: Ia3fb76dd2f4a14eca51b3cfbcd50427b36d946b3
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Rename the main global variables per openbmc style.
Change-Id: I9de8cf841304f24238ae0275b6904f4926a6892d
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Add factories for creating DbusWrite and DbusWritePercent objects and
use these factories.
Change-Id: Iad222d4bf6c1fdf561daa4ba9d88a6644c0a5965
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Add missing try/catch block to getProperties.
Change-Id: Ie1f08f496dc529432df620879416e8bddb2e7d5c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Fix function names to be lower camel.
Change-Id: I145e1f4c03d7740bc1525dcffbdce2f78fd61075
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add try/catch block around ObjectMapper call failures.
Change-Id: I5a2a7a8c1049ea16cebe8b87a509bf5104e432ab
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Rename member functions to be lower camel instead of snake case.
Change-Id: Ib227fd3dadb6d9607290277205223a4324cd4ce5
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Fixup naming of structures to UpperCamel.
Change-Id: I6a9bf0b954298089c85d3362e86cd95b3fc5b944
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Apply const to read-only iterators to indicate intent more clearly.
Change-Id: Ic14304c69361da203d3d3a900180bd54346acc87
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Use local-first search for local headers.
Change-Id: Ib9094836c6b2932804d0d46ca8eaad0e1e4259e4
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
[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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|