summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2017-11-24 15:30:54 +0800
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-01-05 16:10:00 +0000
commiteaab742def0c679ec4e1f61a344aa9ec384d98d5 (patch)
treecc241229aea89f8fbeca605e4bd7b3da306d2dbe
parentfe323d96969fee3be76e1e600566bc4a511315b5 (diff)
downloadtalos-openbmc-eaab742def0c679ec4e1f61a344aa9ec384d98d5.tar.gz
talos-openbmc-eaab742def0c679ec4e1f61a344aa9ec384d98d5.zip
meta-romulus: phosphor-hwmon workaround for fan speed
Romulus uses aspeed pwm and fan tacho, and its driver returns ETIMEDOUT for fan speed when host is off, which causes phosphor-hwmon exit with excpetion for fan_tacho sensors. The workaround is to handle ETIMEDOUT and make it return -ETIMEDOUT value for the sensor. Change-Id: I1c6252c7f0ba1c932948397a9398ff80dfb71e9d Signed-off-by: Lei YU <mine260309@gmail.com>
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%.bbappend7
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%/0001-sysfs-Return-ETIMEDOUT-instead-of-throw-exception.patch35
2 files changed, 42 insertions, 0 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%.bbappend b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%.bbappend
index eb5e22324..bbd977fe2 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%.bbappend
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%.bbappend
@@ -1,5 +1,12 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+# Pin the revision so the patch is guaranteed to be appliable
+# TODO: Remove this when the error handling in hwmon is done:
+# https://gerrit.openbmc-project.xyz/#/c/8073/
+SRCREV = "26d21731c292a02ec71480fade9a06658160eafb"
+
+SRC_URI += " file://0001-sysfs-Return-ETIMEDOUT-instead-of-throw-exception.patch"
+
OCCS = " \
sbefifo@2400/occ@1/occ-hwmon@1 \
hub@3400/cfam@1,0/sbefifo@2400/occ@2/occ-hwmon@2 \
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%/0001-sysfs-Return-ETIMEDOUT-instead-of-throw-exception.patch b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%/0001-sysfs-Return-ETIMEDOUT-instead-of-throw-exception.patch
new file mode 100644
index 000000000..67268b3ea
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%/0001-sysfs-Return-ETIMEDOUT-instead-of-throw-exception.patch
@@ -0,0 +1,35 @@
+From 26989b5e7c85ac1d5715a5ef2667335061920e96 Mon Sep 17 00:00:00 2001
+From: Lei YU <mine260309@gmail.com>
+Date: Thu, 23 Nov 2017 16:14:51 +0800
+Subject: [PATCH] sysfs: Return -ETIMEDOUT instead of throw exception
+
+Aspeed fan tach gives ETIMEDOUT error when host is powered off, it
+causes phosphor-hwmon exit with read failure exception.
+Make it return -ETIMEDOUT so that it gives negative value for fan speed
+as workaround.
+
+Signed-off-by: Lei YU <mine260309@gmail.com>
+---
+ sysfs.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/sysfs.cpp b/sysfs.cpp
+index 369d2e7..f390de6 100644
+--- a/sysfs.cpp
++++ b/sysfs.cpp
+@@ -308,6 +308,12 @@ uint32_t HwmonIO::read(
+ throw std::system_error(rc, std::generic_category());
+ }
+
++ if (rc == ETIMEDOUT)
++ {
++ // Workaround for AST fan tach driver
++ // that returns -ETIMEDOUT when fan is not runnings
++ return -rc;
++ }
+ --retries;
+ std::this_thread::sleep_for(delay);
+ continue;
+--
+1.9.1
+
OpenPOWER on IntegriCloud