| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
At startup, initialize the functional state of each tach sensor to true
and then update the inventory's functional state to match the tach
sensor's functional state.
Resolves openbmc/openbmc#2629
Change-Id: If608e4c044d9eeaa3dbdafa22bc89327e323c9a8
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each fan's tach sensor creates a child inventory object under the fan's
inventory path containing the sensor's functional state. This child
inventory object path is the fan's path plus the tach sensor's defined
id.
i.e.)
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_0
Change-Id: I0fe5000eadbe55d60b475ccad700b0264ed0ac75
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Use the methods provided within sdbusplus.hpp to update fan inventory
along with prepping inventory to be updated for each fan rotor sensor's
functional state.
Change-Id: I7d3026d289b1dd22cd4e7b4457c4d4396309c0b5
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trust group sensors' timers should only start when the sensor is
currently functional and its target and input do not match.
This handles the case where a sensor within a trust group does not get a
target set resulting in both the target and input to be zero.
At anytime a sensor's target and input are equal, the timer to mark them
as nonfunctional should not start.
Change-Id: I8e4fd33a5bcbd25854e5954b41646127982eedd3
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
The Fan class now uses the trust::Manager class
to ask if a sensor value is trusted before analyzing
its value against the upper and lower limits.
Change-Id: I81dd468877873ba84753d76395b4a59129824c0b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It creates a list of group creator lambdas based on
the information in the monitor YAML file.
These lambdas are called by the manager class to create
the trust group instances.
A real life example is:
const std::vector<CreateGroupFunction> trustGroups
{
{
[]()
{
std::vector<std::string> names{
"fan0_1",
"fan1_1",
"fan2_1",
"fan3_1",
};
return std::make_unique<NonzeroSpeed>(names);
}
},
};
Change-Id: Ia883df35efb86242aae2f8ed7d1714e94e65a6e6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Update the YAML documentation with sensor
trust information.
Change-Id: Ia5407b079b5dcfbd4063cec8dbba032fefa11b6b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This class contains the trust groups, and is the interface
for asking if a sensor value can be trusted or not.
It will also start and stop timers on all sensors in the same
group as the timer in question whose trust value just changed.
This class will be used by the Fan class in the speed change
callback function to check if a sensor is trusted before
analyzing its value.
Change-Id: I134be095b6b5222f7bc0e457078cf01f75a36219
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This class provides the ability to only trust
the sensors in the group if at least one of them
has a nonzero speed.
It is being used for a system where the tach values for
a set of rotors are reported as zero by the fan controller
hardware when the other rotor on the fan is moving to a
new target speed. As all the fans are set to the same speed
at the same time, the rotors in question all report as
zeros at exactly the same time, and this is then used to
know when the values cannot be trusted.
Change-Id: I29a014014bc8455287f90e5b573a856814331a53
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The trust::Group class is an abstract base class that
introduces the concept of knowing if a tach sensor
reading can be trusted or not. If it isn't trusted,
then it shouldn't be used when calculating if the fan
is considered functional or not.
It's a group because it supports groups of sensors
all having the same trusted status. For example the
first use case is a group of sensors cannot be trusted
when all of their readings are zero. A group may of
course just have 1 sensor in it if required.
The class also provides the functionality to start and
stop the timers that are used to consider a sensor faulted.
The timers would be stopped when a group moves to untrusted,
and started when it goes back to the trusted state.
Derived classes provide the functionality that actually
determines the trust value.
The constructor takes the list of sensor names that should
be in the group. After the TachSensor classes have been
constructed, the registerSensor(sensor) function must be
called to add the sensor objects to the group.
The checkTrust() function is used to calculate the trust
status of the group.
Change-Id: Ib4b871c6a186105028d1cc186c49611fb0608325
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Upcoming commits will touch the TachSensor timer
outside of the Fan class, and it will be cleaner to
encapsulate the operations in TachSensor.
Change-Id: I8584c44eb5dbe6bb93191a006d20dfc37596eeb3
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allowing fan monitor to run in an init mode will set the fans to a
functional state at each poweron for fans that were non-functional at
poweroff. Then fan monitor can be started in monitor mode after the fans
have ramped up to full speed and can begin being monitored for faults.
This also allows for the removal of fan monitor doing a sd_notify prior
to fan control starting.
Change-Id: I634c9b4ec8bb30860dea54c8abd1cd6c56831d25
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Replace static systemd match callback wrappers with lamba
methods.
Change-Id: Ib8471478824d87483a60f527d29aa2d35ccb833f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
| |
Change-Id: I96ed7de07acfc864c497a0130c3e5afab579d21d
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
TachSensor uses the this pointer as the systemd callback
context for signal callbacks, which doesn't work with
move semantics.
Change-Id: I5e58fec9a7edfc457103d8a36f6076d90246f4f0
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
| |
Don't count sensors that don't exist as nonfunctional. Let some
other application decide if missing sensors are a problem or not.
Change-Id: Ie3d438c92df16bfd86ddc86db8a9dd143bf2cfb0
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
| |
Remove getService from tach_sensor as it is no longer used.
Change-Id: I568afb502379e05e85685d279033ab198c3cc91f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
| |
Replace the implementation of readProperty with a call to the
common property accessor in sdbusplus.hpp.
Change-Id: Ic4ba75bad7458a99f3e29c9235e1a54ae62286fe
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
When a fan gets set to nonfunctional, it is useful
to know how fast the rotor was actually going and
what the expected speed was.
Change-Id: I760d6fa7d193038f9740d241bf4d4d0039020f64
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
Avoid asking the mapper for the Target interface on sensors
that do not have it.
Change-Id: I43f61c98291cc15d7daf43d2b01c6b7fa4edfa62
|
|
|
|
|
|
|
|
| |
Implemented elog exception for phosphor fan presence,
replacing runtime_errors.
Change-Id: I70465060838b2cbaeadccf84ed5924e222ac59e3
Signed-off-by: Dinesh Chinari <chinari@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After the fans have initialized their Functional inventory
property, send systemd the READY notification. If the service
which runs this application is of type = notify, then systemd
will hold off starting any dependent services until this is sent.
In our case, we want phosphor-fan-control --control to not be
started until this notification is done.
Change-Id: Iec87418ce308aa9ca81a47c20039ade7e8fe66c3
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Turns out that with the objects on the stack,
some of them were corrupt in the callbacks.
Change-Id: Ifd4179839d4e05fdb1f05e417093cb14cec3addc
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Convert the sd_event object wrapper from a shared_ptr to
a unique_ptr. Requires a new header file.
Change-Id: I868a9e88ed93878c2e0bb12e58f8d3a604510da0
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
Run the python script to generate fan_zone_defs.cpp
Change-Id: I242aa4246a277509ddbcf1c62fec96782a48b37b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
Generate the data structures from yaml data.
Change-Id: I8e21fa099f9365b8c8c7d2227c4debc263601b72
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Set a fan's Functional property to false when
it has been out of spec for too long. When it
is back in spec, set it back to functional.
Change-Id: I264129479c58fd296df7c3a1d3d42f5d7aa7b60b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
In Fan's tachChanged handler, start up the timer
for a sensor if it is running too slow. If it is
within spec, stop the timer if running and make
the sensor functional again if necessary.
Change-Id: Ib18de2b69942d334da0cb8cd4cc4de8a2784efab
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
Create the Fan objects, and start the dbus/event loop.
Change-Id: I7c6a60bb5d2c20578b529e7e5f3dc13f50e55dd7
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
Add a Timer object to the TachSensor class
Change-Id: I419b5712de9e8e94f2a08de84d13170e44c33c7a
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TachSensor will match on properties changed
signals for the Value and Target properties.
When these occur, it will load in those
properties and then tell the Fan class there
was a change.
Also, TachSensor will read in the Target property
during construction so it will have a valid value
to check against right away.
Change-Id: I2dc2cacf5804826c6b0e0ea91196cbdaa4d5b893
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A Fan object has one or more TachSensor objects.
The TachSensor class is used to keep track of the
the actual and expected speeds. It only tracks
expected speeds if the _hasTarget attribute is true.
Future commits will add more functionality.
Change-Id: I9bb5fac39f25c5c31c18457ebedf82838fcf6641
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This commit contains the data that will be used by
the monitor code.
The generated.cpp file will later be generated during
the build by a python script.
Change-Id: I4dc4552ae8e58cd27478416888dd3363e7c2bf3f
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
This application will monitor the actual speeds of
fans (via their sensors) and compare them to their
expected speeds. If a fan is too slow for too long,
it will have its Functional property in the inventory
set to false. If it starts working again, the property
will be set back to true.
It will use configuration data to say which fans to check
and which values to use for various timeout and deviation
parameters.
Change-Id: Ic61613018a758727835b70f2df0ecd1bf12e8256
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|