From 81dfde0d207ea602364c140ce83f55ef103a223c Mon Sep 17 00:00:00 2001 From: Vincent Pillet Date: Wed, 30 May 2012 14:54:03 +0200 Subject: [PATCH] hsi_ffl_tty.c: Do not rely on TTY_THROTTLE when low_latency is set BZ: 35524 As TTY_THROTTLE can be wrong when tty->low_latency is set (rare race condition identified), we stop relying on this bit. No drawback, as tty_insert_flip_string_flag will return 0. Change-Id: Iede1babcaa076cbb450dfafca4ef5266f37210a1 Signed-off-by: Vincent Pillet Reviewed-on: http://android.intel.com:8080/51986 Reviewed-by: Predon, Frederic Reviewed-by: Lebsir, SamiX Tested-by: Lebsir, SamiX Reviewed-by: buildbot Tested-by: buildbot --- drivers/hsi/clients/hsi_ffl_tty.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/hsi/clients/hsi_ffl_tty.c b/drivers/hsi/clients/hsi_ffl_tty.c index fbe7092..1cd635e 100644 --- a/drivers/hsi/clients/hsi_ffl_tty.c +++ b/drivers/hsi/clients/hsi_ffl_tty.c @@ -29,6 +29,9 @@ /* Set the following to use the WAKE post boot handshake */ #define USE_WAKE_POST_BOOT_HANDSHAKE +/* Set the following to ignore the TTY_THROTTLE bit */ +#define IGNORE_TTY_THROTTLE + #include #include #include @@ -1773,6 +1776,13 @@ static void _ffl_forward_tty(struct tty_struct *tty, while (frame->actual_len > 0) { +#ifndef IGNORE_TTY_THROTTLE + /* In some rare race condition, we can't rely on + * TTY_THROTTLE bit if low_latency is set. + * The FFL can ignore this bit as + * tty_insert_flip_string_fixed_flag will return 0 + * when no more space is left + */ if (test_bit(TTY_THROTTLED, &tty->flags)) { /* Initialised to 1 to prevent unexpected TTY * forwarding resume function schedule */ @@ -1780,7 +1790,7 @@ static void _ffl_forward_tty(struct tty_struct *tty, _ffl_fifo_wait_push_back(ctx, frame); goto no_more_tty_insert; } - +#endif spin_unlock_irqrestore(&ctx->lock, *flags); /* Copy the data to the flip buffers */ -- 2.7.4