[PORT FROM R2] hsi_ffl_tty.c: kill 30-second tty_wait_until_sent timeout and refactor...
authorOlivier Stoltz Douchet <olivierx.stoltz-douchet@intel.com>
Tue, 29 Nov 2011 16:43:07 +0000 (17:43 +0100)
committerbuildbot <buildbot@intel.com>
Mon, 23 Jan 2012 13:16:24 +0000 (05:16 -0800)
commit5ba2c6b6a24d99dd0c2cef5160b3dd95aa580c15
tree2de7d1bc17f807292e4ace05d46a9c35101ac240
parent440c967d6a68a5d982d343562dcb1a99d09938fe
[PORT FROM R2] hsi_ffl_tty.c: kill 30-second tty_wait_until_sent timeout and refactorise code

BZ: 15526

When closing the IFX 0 TTY interface, the TTY layer is relying on the
tty_chars_in_buffer() callback function to wait for the TTY port emptiness. It
is only later that it is calling the wait_until_sent() callback function.
The current implementation is potentially stalling on the first wait loop as
no event is waking the TTY interface up should this happen. The current patch
is addressing this issue by calling a tty_wakeup whenever the last TX message
is returned back from the controller.

Still on this TX path emptiness, a new _ffl_tx_ctx_is_empty() helper function
has been introduced not to consider the TX path as empty as long as there is
write pending - e.g. writes which are no longer in the wait FIFO, but not yet
in the controller.

Finally this patch is also refactoring the _ffl_pop_wait_push_ctrl() to kill a
tail recursion call - which is forbidden in the kernel - and to merge two very
similar function.

Change-Id: Ie3dbe03e285fff60ef172924e2e631f069ffb9c8
Orig-change-Id: I40da402cdbbcc953912adfcaae4265ec48e8af54
Signed-off-by: Olivier Stoltz Douchet <olivierx.stoltz-douchet@intel.com>
Reviewed-on: http://android.intel.com:8080/31431
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