summaryrefslogtreecommitdiffstats
path: root/drivers/serial/mpsc.c
diff options
context:
space:
mode:
authorStephane Chazelas <stephane@artesyncp.com>2007-07-31 09:38:59 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-01 00:39:41 +0200
commit5797ae364c35db8c184f38b37595be59bf761e93 (patch)
tree2912a5178b0d5df95d8b0b759bca1c2ac9a7f8c2 /drivers/serial/mpsc.c
parentserial: MPSC: Remove race between Rx stop & restart (diff)
downloadlinux-5797ae364c35db8c184f38b37595be59bf761e93.tar.xz
linux-5797ae364c35db8c184f38b37595be59bf761e93.zip
serial: MPSC: Stop rx engine when CREAD cleared
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@artesyncp.com> Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/mpsc.c')
-rw-r--r--drivers/serial/mpsc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index 567fa789c5c7..e984abf3e4d9 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -1520,7 +1520,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)
@@ -1544,11 +1543,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;