mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mark A. Greer" <mgreer@mvista.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: stephane@artesyncp.com, Andrew Morton <akpm@osdl.org>
Subject: [PATCH 2/4] serial: MPSC: Stop rx engine when CREAD cleared
Date: Thu, 19 Jul 2007 10:29:02 -0700	[thread overview]
Message-ID: <20070719172902.GB589@mag.az.mvista.com> (raw)
In-Reply-To: <20070719172617.GA589@mag.az.mvista.com>

From: Stephane Chazelas <stephane@artesyncp.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@artesyncp.com>
Signed-off-by: Mark A. Greer <mgreer@mvista.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;


  reply	other threads:[~2007-07-19 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 17:26 [PATCH 1/4] serial: MPSC: Remove race between Rx stop & restart Mark A. Greer
2007-07-19 17:29 ` Mark A. Greer [this message]
2007-07-19 17:30 ` [PATCH 3/4] serial: MPSC: Remove duplicate SUPPORT_SYSRQ definition Mark A. Greer
2007-07-19 17:31 ` [PATCH 4/4] serial: MPSC: Fix coding style and whitespace issues Mark A. Greer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070719172902.GB589@mag.az.mvista.com \
    --to=mgreer@mvista.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephane@artesyncp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®