diff options
Diffstat (limited to 'meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon%')
-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.patch | 35 |
1 files changed, 35 insertions, 0 deletions
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 + |