Fix incorrect host time issue switching to SPLIT

The time tests find an issue that when owner is set to Split, and
then set the BMC time, the host time becomes incorrect.

The root cause is that the diff between host time and steady clock is
not updated when the owner is changed to Split, and thus when BMC
time is changed, the host time is calculated incorrectly.

The fix is to re-calculate the diff between host time and steady clock
in this case.

Resolves openbmc/openbmc#901

Change-Id: Ida22f27c6adba6b1cf8a41274eb5f26b6f1bdab7
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/host_epoch.cpp b/host_epoch.cpp
index 99cdf6d..8415f15 100644
--- a/host_epoch.cpp
+++ b/host_epoch.cpp
@@ -87,6 +87,14 @@
         offset = microseconds(0);
         saveOffset();
     }
+    else
+    {
+        // In SPLIT, need to re-calculate the diff between
+        // host and steady time
+        auto steadyTime = duration_cast<microseconds>(
+            steady_clock::now().time_since_epoch());
+        diffToSteadyClock = getTime() - steadyTime;
+    }
 }
 
 void HostEpoch::saveOffset()