From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128Ab3DOQFO (ORCPT ); Mon, 15 Apr 2013 12:05:14 -0400 Received: from mailout02.c08.mtsvc.net ([205.186.168.190]:48251 "EHLO mailout02.c08.mtsvc.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426Ab3DOQCm (ORCPT ); Mon, 15 Apr 2013 12:02:42 -0400 From: Peter Hurley To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Hurley Subject: [PATCH 13/20] n_tty: Eliminate char tests from IXANY restart test Date: Mon, 15 Apr 2013 11:32:44 -0400 Message-Id: <1366039971-8770-14-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1366039971-8770-1-git-send-email-peter@hurleysoftware.com> References: <1366039787-8719-1-git-send-email-peter@hurleysoftware.com> <1366039971-8770-1-git-send-email-peter@hurleysoftware.com> X-Authenticated-User: 125194 peter@hurleysoftware.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Relocate the IXANY restart tty test to code paths where the the received char is not START_CHAR, STOP_CHAR, INTR_CHAR, QUIT_CHAR or SUSP_CHAR. Fixes the condition when ISIG if off and one of INTR_CHAR, QUIT_CHAR or SUSP_CHAR does not restart i/o. Signed-off-by: Peter Hurley --- drivers/tty/n_tty.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 8808833..33994e6 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -1269,13 +1269,6 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) return; } - if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && - I_IXANY(tty) && c != START_CHAR(tty) && c != STOP_CHAR(tty) && - c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) && c != SUSP_CHAR(tty)) { - start_tty(tty); - process_echoes(tty); - } - /* * If the previous character was LNEXT, or we know that this * character is not one of the characters that we'll have to @@ -1284,6 +1277,13 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) */ if (!test_bit(c, ldata->char_map) || ldata->lnext) { ldata->lnext = 0; + + if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && + I_IXANY(tty)) { + start_tty(tty); + process_echoes(tty); + } + parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; if (read_cnt(ldata) >= (N_TTY_BUF_SIZE - parmrk - 1)) { /* beep if no space */ @@ -1330,6 +1330,11 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) } } + if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && I_IXANY(tty)) { + start_tty(tty); + process_echoes(tty); + } + if (c == '\r') { if (I_IGNCR(tty)) return; -- 1.8.1.2