sysfs IO enhancements
Add retries for some sysfs IO errors:
EIO: Tolerate intermittant device or bus failures.
ETIMEDOUT: Tolerate intermittant timeouts.
EAGAIN: Tolerate drivers that do not block.
ENXIO: Tolerate momentarily unplugged devices on busses that don't
support hotplug.
EBADMSG: Tolerate CRC errors.
Flush stdio buffers after writes.
Remove redundant retry and delay constants.
Resolves: openbmc/openbmc#2262
Change-Id: I2104139bf7ced96bb10f7450b42ca36e61c84287
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/fan_speed.cpp b/fan_speed.cpp
index 5e4c9fc..c156258 100644
--- a/fan_speed.cpp
+++ b/fan_speed.cpp
@@ -23,7 +23,10 @@
value,
type,
id,
- entry::target);
+ entry::target,
+ sysfs::hwmonio::retries,
+ sysfs::hwmonio::delay);
+
}
catch (const std::system_error& e)
{
@@ -60,7 +63,9 @@
enable::rpmMode,
type::pwm,
id,
- entry::enable);
+ entry::enable,
+ sysfs::hwmonio::retries,
+ sysfs::hwmonio::delay);
}
catch (const std::system_error& e)
{