[PORT FROM R2] hsi_ffl_tty.c: manage system time changes
BZ: 15919
Should a system time change happen between a stop_tx and start_tx then a delay
of the same duration as the time change can be observed in the write function.
As the write function cannot exit prior to the expiration of this delay, the
system is detecting an unresponsive write request and some mechanism is
rebooting the platform.
The patch presented below is simply casting the result of the time difference
to an unsigned integer (instead of a signed one) so that should the new time be
set prior to the current time, the time difference will be positive and no
delay will be taken.
One can argue that the delay will not be respected in such cases, but it is not
possible to guarantee such delays without adding a new real timer.
Change-Id: I46b2ecdf43e6070417cdb6b0f527d5c6639ec89e
Orig-change-Id: I51413a04a9aa9309d27f27268d642c1a79796dea
Signed-off-by: Olivier Stoltz Douchet <olivierx.stoltz-douchet@intel.com>
Reviewed-on: http://android.intel.com:8080/31428
Reviewed-by: Pillet, VincentX <vincentx.pillet@intel.com>
Reviewed-by: Predon, Frederic <frederic.predon@intel.com>
Reviewed-by: Lebsir, SamiX <samix.lebsir@intel.com>
Tested-by: Lebsir, SamiX <samix.lebsir@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>