Fix for cpusensor going into D state.

When PECI driver returns the error code EAGAIN, async_read_until will
go into a keep trying again loop. As async_read_until does not handle
EAGAIN reliably.

Same issue was identified and fix for PSUSensor:
https://github.com/openbmc/dbus-sensors/commit/bcf76717697238e380be785bd28150963ecf0e9e

Fix for this is to use async_wait instead of async_read_until.

Tested:
In Intel system verified cpusensor daemon is not getting into D state
when there is a peci error EAGAIN.
Verified sensors are getting populated as expected when there is no PECI
error.

Signed-off-by: Arun Lal K M <arun.lal@intel.com>
Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
Change-Id: I52e35075e522d0ae0d99e1c893db76156e299871
diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
index 3f16069..e667897 100644
--- a/include/CPUSensor.hpp
+++ b/include/CPUSensor.hpp
@@ -46,9 +46,11 @@
     size_t pollTime;
     bool loggedInterfaceDown = false;
     uint8_t minMaxReadCounter;
+    int fd;
     void handleResponse(const boost::system::error_code& err);
     void checkThresholds(void) override;
     void updateMinMaxValues(void);
+    void restartRead(void);
 };
 
 extern boost::container::flat_map<std::string, std::shared_ptr<CPUSensor>>