summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch
blob: c04d16feb14dadeb1f7bd4dbdf16654fb6cfc053 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 6c482ff2206cedea73615d3c0370f6edfd245a08 Mon Sep 17 00:00:00 2001
From: Zhikui Ren <zhikui.ren@intel.com>
Date: Fri, 19 Feb 2021 12:14:05 -0800
Subject: [PATCH] Fan Tach Sensor Threshold Ignore Zero

Currently there are systems that have system fans plugged
into different fan connectors. Fan present detection is
not supported in most of these systems. Critical low
threshold is asserted for the non-utilized fans
resulting in FSC boost all fans.

Skip threshold checking for fan tach reading less or equal
to zero. This is a temporary WA until a more robust solution
is available.

Note: with this workaround a completely non-working fan
will not be detected. FSC will still boost fans due to other
constraints if the system can't be cooled with the working fans.

Tested:
No cr event for the missing fans.

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@intel.com>
Change-Id: I6ef1d61573dcb8c15c0b76a6a6805f368be13fc0
---
 src/TachSensor.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
index 2c48cc9..e85a2a2 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -183,12 +183,19 @@ void TachSensor::handleResponse(const boost::system::error_code& err)
 
 void TachSensor::checkThresholds(void)
 {
-    bool status = thresholds::checkThresholds(this);
+    // WA - treat value <= 0 as not present
+    bool status = false;
 
-    if (redundancy && *redundancy)
+    if (value > 0)
     {
-        (*redundancy)
-            ->update("/xyz/openbmc_project/sensors/fan_tach/" + name, !status);
+        status = thresholds::checkThresholds(this);
+
+        if (redundancy && *redundancy)
+        {
+            (*redundancy)
+                ->update("/xyz/openbmc_project/sensors/fan_tach/" + name,
+                         !status);
+        }
     }
 
     bool curLed = !status;
-- 
2.17.1