diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2017-12-14 11:14:30 -0600 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2017-12-14 11:14:30 -0600 |
commit | e4338cdb856db2b71f8adf42c50603d816980f8a (patch) | |
tree | 4eb0f1e20c93c0b06830cd4932f2002353f67aba /control/zone.cpp | |
parent | e65f617c6a79eb92c122310f35ddb8a496e729fd (diff) | |
download | phosphor-fan-presence-e4338cdb856db2b71f8adf42c50603d816980f8a.tar.gz phosphor-fan-presence-e4338cdb856db2b71f8adf42c50603d816980f8a.zip |
Decreases allowed based on all groups
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>
Diffstat (limited to 'control/zone.cpp')
-rw-r--r-- | control/zone.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/control/zone.cpp b/control/zone.cpp index ffde46a..209d773 100644 --- a/control/zone.cpp +++ b/control/zone.cpp @@ -270,9 +270,17 @@ void Zone::requestSpeedDecrease(uint64_t targetDelta) void Zone::decTimerExpired() { - // Only decrease speeds when no requested increases exist and - // the increase timer is not running (i.e. not in the middle of increasing) - if (_incSpeedDelta == 0 && !_incTimer.running()) + // Check all entries are set to allow a decrease + auto pred = [](auto const& entry) {return entry.second;}; + auto decAllowed = std::all_of(_decAllowed.begin(), + _decAllowed.end(), + pred); + + // Only decrease speeds when allowed, + // where no requested increases exist and + // the increase timer is not running + // (i.e. not in the middle of increasing) + if (decAllowed && _incSpeedDelta == 0 && !_incTimer.running()) { auto requestTarget = getRequestSpeedBase(); // Request target speed should not start above ceiling |