[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070719172902.GB589@mag.az.mvista.com>
Date: Thu, 19 Jul 2007 10:29:02 -0700
From: "Mark A. Greer" <mgreer@...sta.com>
To: lkml <linux-kernel@...r.kernel.org>
Cc: stephane@...esyncp.com, Andrew Morton <akpm@...l.org>
Subject: [PATCH 2/4] serial: MPSC: Stop rx engine when CREAD cleared
From: Stephane Chazelas <stephane@...esyncp.com>
Currently, the MPSC driver doesn't stop recieving characters when the
CREAD flag in termios->c_cflag is cleared. It should. Also, only start
receiving if its not already started.
Signed-off-by: Stephane Chazelas <stephane@...esyncp.com>
Signed-off-by: Mark A. Greer <mgreer@...sta.com>
---
drivers/serial/mpsc.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index 99715fe..108fa4c 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -1536,7 +1536,6 @@ mpsc_set_termios(struct uart_port *port, struct ktermios *termios,
mpsc_set_baudrate(pi, baud);
/* Characters/events to read */
- pi->rcv_data = 1;
pi->port.read_status_mask = SDMA_DESC_CMDSTAT_OR;
if (termios->c_iflag & INPCK)
@@ -1560,11 +1559,15 @@ mpsc_set_termios(struct uart_port *port, struct ktermios *termios,
pi->port.ignore_status_mask |= SDMA_DESC_CMDSTAT_OR;
}
- /* Ignore all chars if CREAD not set */
- if (!(termios->c_cflag & CREAD))
+ if ((termios->c_cflag & CREAD)) {
+ if (!pi->rcv_data) {
+ pi->rcv_data = 1;
+ mpsc_start_rx(pi);
+ }
+ } else if (pi->rcv_data) {
+ mpsc_stop_rx(port);
pi->rcv_data = 0;
- else
- mpsc_start_rx(pi);
+ }
spin_unlock_irqrestore(&pi->port.lock, flags);
return;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists