summaryrefslogtreecommitdiffstats
path: root/sysfs.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-10-04 15:53:56 -0500
committerMatt Spinler <spinler@us.ibm.com>2017-10-09 10:21:55 -0500
commit8a37c4b7b1e990fbf58b79204472f2add6b65841 (patch)
tree30187d24c9418f244a4d4ac889babbf5a1e95be8 /sysfs.cpp
parentc923ce9dd41e9a064dc0a0b11c601599dc6acdd9 (diff)
downloadphosphor-hwmon-8a37c4b7b1e990fbf58b79204472f2add6b65841.tar.gz
phosphor-hwmon-8a37c4b7b1e990fbf58b79204472f2add6b65841.zip
Retry on ENODEV errnos
This errno can be returned by certain device drivers when they are in the process of being unbound. Retrying will give the driver time to finish unbinding, and phosphor-hwmon will then die off naturally as phosphor-hwmon's lifetime is tied to the loaded driver's. Resolves openbmc/openbmc#2401 Change-Id: Ife888f3b608d7694d22f95412a7d320377daefa4 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'sysfs.cpp')
-rw-r--r--sysfs.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysfs.cpp b/sysfs.cpp
index 9cf1552..369d2e7 100644
--- a/sysfs.cpp
+++ b/sysfs.cpp
@@ -54,6 +54,14 @@ static constexpr auto retryableErrors = {
* eventually get ENOENT.
*/
ENXIO,
+
+ /*
+ * We can see this from some drivers when we try to do
+ * a read in the middle of them being unbound. The
+ * unbinding should complete before the retries are up
+ * and kill this process.
+ */
+ ENODEV,
};
static const auto emptyString = ""s;
OpenPOWER on IntegriCloud