| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add functions to set and get persisted properties on a zone by the
interface and property name. When a property exists, it is persisted
each time it is updated.
Tested:
Current property is added and persisted.
When Current property not added, it is not persisted.
Change-Id: I2540c3673affcda871c9342cad44e85a4510d756
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Before updating the current mode, verify that the mode provided by the
end-user is in the list of modes that are supported.
Tested:
Only supported modes can be set as the current mode
Change-Id: Ie21839b6bf7245756fedf417e143c28bc9da32f1
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When restoring the persisted current mode, initially set the current
mode to what's already provided. When no interface is defined within the
zone yaml, a default value of "Default" is already set on the
Control.ThermalMode interface. If an interface is provided on the zone
yaml, and the Current property is initialized to a value, use this value
initially upon restoring. During the restore, this value could change to
what was persisted.
Tested:
Current mode is set correctly upon initialization & restore
Change-Id: I0fae247303903d85e95fc044c96fc1809df2fa03
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Always set the current thermal control mode in uppercase to handle case
insensitive modes given since it would be something possibly set by the
end-user.
Tested:
Current mode always set in uppercase
Change-Id: Ie159de24f5f9b4dd5651a9411f7b176501c4846a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Properties hosted by a zone object need the ability to be set upon zone
initialization. This adds support to allow the zone configuration yaml
to contain what properties to set and with what values on a zone. The
parser updates to generate what uses this framework is in a followup
commit.
Change-Id: I9fd93746cc097f05869400451daff03cf3ef89b7
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
| |
A zone's object path is set when the zone is created and available to be
used instead of determining the zone's object path each time.
Change-Id: Iddfebd1545bb49054d95f8c19a71b2fbf9c2f592
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each time the current mode property changes, handle the event similarly
to other event signal triggers substituting with a null message. When
the handler receives a null message, the property's value that triggered
the event is retrieved whether from the zone object or from dbus.
Tested:
Triggered the use of alternative events based on thermal control
mode property state
Change-Id: Ibc663c3721c331393250bd32bda0d45cf0214f12
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Properties on the zone object require their event data to be stored for
retrieval when their value changes, which allows the use of the current
event handlers to update the cached value and trigger the event actions.
When any event is initialized, any signals where the match string is
empty performs a lookup for each group member to determine if they are
on the zone object. Each member found to be on the zone object is then
stored with the that event's data.
Tested:
Verified event data is stored for members on the zone object
Verified event initialization correctly accesses zone object
member's event data
Change-Id: Id34f60eb12330428eeb1041de4e9bd1a4a686f21
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
| |
When the Current mode property changes, the persisted value is updated.
Change-Id: I319fbe2afb8112f7425dc0a1d765fe8f1c408bae
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
When the fan control zone is created, the current mode property is
restored from persistent storage. If the persistent storage file does
not exist or fails to be read, the current mode property is set to
default.
Change-Id: I5ba699f9b6683aea4f39444eace8c7d19a22c92d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Add the ability to save the current mode property value to
persisted storage.
Change-Id: I354fce7c11a61871a49c9b205dc79ee598f8b1c8
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When in control mode, the thermal control interface and mode property
are added to each zone object. The object path for each zone consists of
the configured object path plus the zone number.
Ex) /xyz/openbmc_project/control/thermal/0
Tested:
After fan control is started in control mode, dbus interface exists
Change-Id: I88578a7e0eb7c730ffaa4cfc10989e280dc1d46d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a service is cached, each interface it hosts is added to a list. In
the case where an object path given to fan control is never found, a
service lookup is performed on this path causing its given interface to
be added. This fixes that interface from continuously being added in the
case that the object path is attempted to be accessed continuously from
dbus.
Resolves openbmc/phosphor-fan-presence#12
Tested:
Added & removed events containing object paths that dont exist,
interface list remains the same size.
Change-Id: Id034e7829566979c196cb9901cbea287ddab78d4
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
| |
Change-Id: I5ab5adcc22f044b3cf0955082061c67f2a281307
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want to copy the object out of the container we are iterating
over.
Tested:
Built and run through unit tests.
Change-Id: I68b041f98e1c6a6a9dbc59448b629e1d22ba62c9
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each event could have multiple signals associated and when the event is
removed, all of those signals should also be removed. This ensures no
dangling signals remain after an event is removed from be processed by
fan control
Tested:
The total number of signals subscribed are reduced by the same
number of signals of a removed event
Change-Id: I651f70dbe6aed9c7eef06aff4eac9eae7ad89d77
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces a layer of indirection since the function can be called
directly instead of indirectly accessing it with the lambda. It also
makes the instantiation more flexible since it can match callbacks with
extra arguments.
Tested:
Built and run through unit tests.
Change-Id: I5317203fa70c027c5e774ed6192952058e35bd81
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
Tested:
Built and ran through unit tests.
Change-Id: I9a98d9a3eaee47885b18b642ffd01a38a864dd02
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Anything adding a timer uses roughly the same process of building the
event data and timer from the event group, actions, and timer config. We
can adjust the method to do this for all callers.
Tested:
Builds and passes unit tests.
Change-Id: I4013ff2f7bff65095a6e1db7075bc013da374f51
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is confusing to read some of the type definitions that deal with
timers when Timer could mean a timer instantiation or a set of timer
configuration parameters. This change disambiguates the two types.
Tested:
Built and run through unit tests.
Change-Id: I9dd6b47886747d56a86b6a50eb9a74a331d0a1fe
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed for a future commit that removes the local
phosphor::util::Timer implementation.
Tested:
Built and run through unit tests.
Change-Id: I8ea3399fec8761055d4a0d94fb9ea91fd34040ea
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All 3 fan applications - control, monitor, and presence
have cases where it is expected that a getProperty call
may fail because a sensor is missing. While the applications
already handle this, the InternalFailure exception that was
being thrown by the underlying call generates log entries
that make it look like something bad happened.
The custom exceptions now being thrown do not log anything on
creation, but store all of the failing information so that
any callers could still log the info if they wanted to.
Tested: Boot a water cooled Witherspoon and see the fan presence
and monitor applications not look like they are
failing. Boot a system without the fan hwmon running,
and see fan-control-init still show the fails.
Change-Id: Ifd8ad6e3deb492bbaf33f12c7258125dce1e5ea8
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Retrieve the service names from the cached dataset within the zone for a
path and interface, updating the cache when not found. This is used when
initializing property values and service name owners.
Additional performance enhancements to use `GetSubTree` prior to
processing a set speed event will be included under
openbmc/openbmc#2911. This will keep unnecessary `GetSubTree` lookups
from occurring for paths/interfaces that don't exist to further improve
upon initializing properties fan control is defined to use.
Tested:
First path updates service name cache for all paths sharing the same
interface
First missing interface on a path updates service name cache for all
paths sharing that interface
Verify mapper lookups for X number of paths sharing the same
interface is reduced to (X-(X-1))
NameOwnerChanged events read/update the same set of service name
cache
Change-Id: Ia235b36ba5ae8cda38342d7521f3d87080c2970a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To lookup a service name for a given path and interface, use GetSubTree
to retrieve all the service names from the root path for the interface
and add each entry to a cached dataset.
Tested:
Check that a missing interface's service is added
Check that a missing path that exists has its service added
Inspect all missing paths for an interface are added
Inspect missing interfaces are added to existing service
Returned service name matches the service for a path/interface
Change-Id: I6db05479e825350198896b2e237882f7ebc58d51
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For speed decreases to occur, all sensor groups involved with setting a
net decrease delta must be below their given t-control low values for
the associated zone. This handles the case where one or more sensor
groups' temperatures stabilize above their t-control low value, but one
or more other sensor groups' temperatures are below their t-control low
value which would result in speed decrease requests that could
eventually lead to fan speed oscillations.
Resolves openbmc/openbmc#2710
Change-Id: I382de5d3f9c3e631a332d49dfcb06e705ff6fc17
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
When determining the request base speed for speed decreases, the current
ceiling speed should be used when the request base speed is above the
ceiling.
Change-Id: Iefc2f1669b853e099fbda15dc8c8983f5f1f269a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
| |
Change-Id: Ia56acbeaa89423060e65e50eff8accffec5a4631
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Before refreshing the service names and states for a group, the empty
service name should be removed if it exists. An empty service name may
exist where upon startup, a particular service was not found for a
member or members of a group.
Change-Id: I15d224231bb9db0823866393ec1776f793a3c126
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to an action resulting from missing service owners, all of the
services for a group should be refreshed to ensure they are in the most
up-to-date state. Ensuring the service states are current allows the
action to be correctly taken since owners of services could change at
anytime.
Change-Id: I59c59c6fcf456fa9c0a733d6406c90ea11f6e2b2
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whenever fan control (control mode) is started, the target speed for
each zone should be initialized to the currently set target speed.
In the case where a watchdog has triggered the fans to full speed
and the target speed does not reflect this, the proper set of set speed
events should be configured. In this case, an event could be defined to
use the current tach feedback to adjust the target speed prior to
account for the real state of the fan speeds.
Change-Id: I538644ffc83a6e01469174304d393c889038d066
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An action to set the fan floor speed to the defined default fan floor
speed when any services associated to a given group of sensors have
terminated. Once those services are functional and providing the
sensors, the fan floor is allowed to be set normally again.
i.e.) For fan floor speeds based on an ambient sensor, if the service
providing the ambient temperature value from the sensor terminates, the
default floor for the zone is used as the fan floor speed.
Change-Id: I2d58cc9b31051e6b8e5e798c0a736f58f5efe5b1
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Events defined to have timers require the ability to find a timer, add a
timer to the event, and removing a timer event entirely. These event
timers are intended to allow actions based on the event to be delayed or
recurring based on the timer defined.
Change-Id: Ieaf26f031c5e5aac9472e92354bfb76392642cb4
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
| |
This is the first step towards allowing timer driven and/or wrapped
actions where the timer interval and type will be defined by the user.
Change-Id: If008fda5a2b73117e869f93223e0bfe61290f858
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Adds a service name associated with a group when the group or given
service name is not found within the map of services otherwise updates
the service name owner associated with the group.
Change-Id: I602ddaa7e06e354e01ea70d6c5c0a45e74a14e99
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using a null dbus message to the event signal will perform the necessary
steps to initialize the event parameters using the given signal
handler's function directly.
i.e.) In the case for subscribing to PropertiesChanged signals,
initially the given property must be read. When the PropertiesChanged
signal struct is given a null message, it finds the property, reads the
value, and then can perform the given signal handler function directly.
This produces the same functional path as receiving a PropertiesChanged
signal containing the property value within the message.
Change-Id: I35575cfff66eb0305156be786cb1f5536d42bb1c
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
The available matches and their associated signals are now listed
within the events yaml and can be added to the list of matches to
register for per event.
Change-Id: I65f657038afe7c68a421adb4820ea09e275be06d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
For increase and decrease speed changes, the new target speed is
calculated from either a set speed request base value or the current
target speed by default.
Change-Id: Iad1411437a9945af0b9ae85649d487e36586ef2a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Each set speed event will contain a list of one-to-many actions to
perform for the given event group's property. This reduces the amount of
code generated and properly handles property changed events against the
group.
Change-Id: If2b8c0d0b8ecf6e1c974c43d96e1c6e9e952022b
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fan control is allowed to have properties not be found, so log these as
informational for users. If the property is not found, then any set
speed events related to that property should handle it appropriately.
Resolves openbmc/openbmc#2188
Change-Id: I7c9e5fc8a3291d19ab4b1853af340643d3fa67a2
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A zone is actively controlling its fan speeds when all groups subscribed
to allow active control are set to true. The zone keeps a list of these
groups and their active allow state, if at anytime an action (or
precondition) sets a group's active state to false, any dynamic set
speed requests do not occur. Only requests to set the zone's fans to
full speed is allowed.
Related to this, the zone's target speed should only be updated when a
requested speed is successfully set.
Change-Id: Iec6f15346fee5a6c6046d5b00e949e46aef400b9
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
For groups within set speed events where the property values of the
group may not signal its action to occur, an optional timer may be added
to the event. This timer is configured as a repeating timer on the
interval provided where upon timer expiration, the event's action is
run.
Change-Id: I4cbe8a0ab1b734bfc7828706a6515af7f6d78b52
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Allows the complete removal of a set speed event from the zone. This is
done when any precondition defined for the event to be active is not
met any longer.
Change-Id: Idbec357f76f0fd7db9107e8c9d3e00461872c528
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
The property state check precondition validates that each given property
matches the defined value. When all the precondition groups' property
states match, the given set speed event is initialized and activated
allowing the zone speeds to be active controlled.
Change-Id: Ic16a0e1fc584c6fa695e354fa80fb1993002ffc7
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Any defined preconditions for a set speed event must be satisfied prior
to configuring the event parameters for fan control. These preconditions
will accept a list of group entries that include the value the group's
property must be to have the precondition met for that group. Once all
preconditions are met, the set speed event will be initialized and
become active.
Change-Id: Ia5555be55c5937c891af527bea63da1546655b2f
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support setting the increase delay time(in seconds) for each zone from
the zone yaml file. Speed increases use a delay type timer where the
amount of time given delays additional increase requests from happening
until the fans within the zone reach the highest net increase in speeds.
Support setting the decrease interval time(in seconds) for each zone
from the zone yaml file. Since decreasing is done on an interval, a
decrease interval time of zero disables the decrease interval timer
causing no decreases in speed to occur. Speed decreases use an interval
type timer to decrease the fan speeds within the zone when no speed
increase requests exist on the given time interval.
Change-Id: I88334a313b6e2820b768fa7e3f1cb65887f29258
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|