summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-11-16 13:03:16 -0600
committerMatt Spinler <spinler@us.ibm.com>2017-11-16 13:21:42 -0600
commit67ce4a46999012eba2a0015a51619f474967d21c (patch)
tree5c2d7a92f02ca6f699a7c1bbe7de400929309930
parent4d9a35b232f0bfabe961768f346d958399ff0dec (diff)
downloadphosphor-hwmon-67ce4a46999012eba2a0015a51619f474967d21c.tar.gz
phosphor-hwmon-67ce4a46999012eba2a0015a51619f474967d21c.zip
Retry on ENODATA errors
A particular device in a particular system is known to fail with an ENODATA errno when another entity is using the same path to access it. Add it to the retry list so that phosphor-hwmon will retry and hopefully be able to get a clean read. Even for devices where this contention isn't the case, the code may as well retry as opposed to trying once and giving up. Resolves openbmc/openbmc#2645 Change-Id: Ib7aaaa14be33a33794a8c62d6991f77ab65a2ffa Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r--sysfs.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysfs.cpp b/sysfs.cpp
index 369d2e7..8b7ee48 100644
--- a/sysfs.cpp
+++ b/sysfs.cpp
@@ -62,6 +62,14 @@ static constexpr auto retryableErrors = {
* and kill this process.
*/
ENODEV,
+
+ /*
+ * Some devices return this when they are busy doing
+ * something else. Even if being busy isn't the cause,
+ * a retry still gives this app a shot at getting data
+ * as opposed to failing out on the first try.
+ */
+ ENODATA,
};
static const auto emptyString = ""s;
OpenPOWER on IntegriCloud