| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This removes the custom timer implementation and moves to the
sdeventplus utility. Functionally this should make no change
Tested:
Built and run through the unit test suite.
Change-Id: Ib7ee90d489d5db72496aaaca91c3cf5490ad47d6
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
This change is mostly focused around plumbing the sdeventplus::Event
object everywhere and using the member functions provided for the event.
No migration to the timer utility is performed yet.
Change-Id: I912ab82bc081239d3b7c3cf7c5caca6742ef9c87
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a single timer on the tach sensors for delaying both nonfunctional
and functional state changes by declaring what mode the timer is in.
Since a fan is either transitioning from a functional state to a
nonfunctional state or vice-versa, enabling the timer in the mode
requested allows the user to define a delay for both of these transition
states.
Tested: Current nonfunctional timer delay operates the same
Change-Id: I0c165355d41d27e1906918953e5226968062ee16
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add ability to define a delay to marking a tach sensor as functional
when it transitions from a nonfunctional state. Essentially this gives
the option to wait a given amount of time that a tach sensor must be
within the allowed deviation before being updated to functional.
Default functional delay = 0 seconds
Tested: Current fan definition values function the same
Change-Id: I58bf70d2335e27c06037b755cbee8dae81528a5a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current fan monitor assumes the use of the FanSpeed interface for fan
targets.
For fans controlled by pwm, FanPwm interface is added.
This commit adds a "target_interface" config parameter, so that user
can specify the interface for the fan targets.
E.g.
- name: fan0
has_target: true
target_interface: xyz.openbmc_project.Control.FanPwm
This config is optional and defaults to FanSpeed, so the current code
will not be affected.
Tested: Use this config on Romulus, ensures fan monitor gets fan
target from FanPwm interface and works OK.
Change-Id: I262a486c335b2b43a46af7abdd0e71e95a133b98
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For fans controlled via pwm, the fan target and speed are different,
where the fan target is pwm and the speed is rpm.
Usually it is a linear mapping from pwm to rpm.
So this commit defines the optional configs, factor and offset for
calculating the expected fan speed from target, e.g.
- name: fan0
has_target: true
factor: 21
offset: 1600
The fan monitor service will calculate expected fan speed as:
target * factor + offset
The default value is 1 for factor and 0 for offset if they are not
defined.
Tested: Use this config together with the following commit's changes,
test on Romulus and ensures the fan monitor works OK;
Without this config, fan monitor always mark fans as
non-functional due to the fan speed does not match the pwm
value.
Change-Id: If5e25368b4530df7a7face9377efb58804db21df
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
With the addition of a functional state for each fan rotor tach sensor,
these should be set to functional on each power on. This is done during
fan monitor init mode when no monitor is done and then again once
monitoring mode begins.
Change-Id: I3c73c1be5f912c7cee8499f47cc799ac3c20983b
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All tach sensors associated with a fan should return a target speed
sensor from its getTarget function. In the case where a target speed
sensor does not exist for the tach sensor, it retrieves and returns the
target speed value from the fan where the fan finds the target speed
value from a tach sensor the fan contains that provides it.
Resolves openbmc/openbmc#2784
Change-Id: Iea5561b0aad6942be52af262c7255c60e5e75c7a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Replace static systemd match callback wrappers with lamba
methods.
Change-Id: Ib8471478824d87483a60f527d29aa2d35ccb833f
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>
|
|
|
|
|
|
|
| |
Remove getService from tach_sensor as it is no longer used.
Change-Id: I568afb502379e05e85685d279033ab198c3cc91f
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|