[PORT FROM R2] hsi_ffl_tty.c: manage system time changes
authorOlivier Stoltz Douchet <olivierx.stoltz-douchet@intel.com>
Thu, 1 Dec 2011 14:38:18 +0000 (15:38 +0100)
committerbuildbot <buildbot@intel.com>
Wed, 18 Jan 2012 18:55:39 +0000 (10:55 -0800)
commite5ff665348dd0933009d6083d634296ea987531d
treec781ae51a9e1bd6032b9eee194ef42fc857f4c76
parent563dc9e6169185baf69071c57de580040a43f2d4
[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>
drivers/hsi/clients/hsi_ffl_tty.c