mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [CFT:PATCH] 2/3: Check status of CTS when using flow control
Date: Sun, 26 Jun 2005 23:17:50 +0100	[thread overview]
Message-ID: <20050626221750.GA5789@dyn-67.arm.linux.org.uk> (raw)
In-Reply-To: <20050626221501.GA5769@dyn-67.arm.linux.org.uk>

Fix bugme #4712: read the CTS status and set hw_stopped if CTS
is not active.

Thanks to Stefan Wolff for spotting this problem.

Index: drivers/serial/serial_core.c
===================================================================
--- a/drivers/serial/serial_core.c  (mode:100644)
+++ b/drivers/serial/serial_core.c  (mode:100644)
@@ -180,6 +180,13 @@
 			 */
 			if (info->tty->termios->c_cflag & CBAUD)
 				uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR);
+
+			if (info->flags & UIF_CTS_FLOW) {
+				spin_lock_irq(&port->lock);
+				if (!(port->ops->get_mctrl(port) & TIOCM_CTS))
+					info->tty->hw_stopped = 1;
+				spin_unlock_irq(&port->lock);
+			}
 		}
 
 		info->flags |= UIF_INITIALIZED;
@@ -1134,6 +1141,16 @@
 		spin_unlock_irqrestore(&state->port->lock, flags);
 	}
 
+	/* Handle turning on CRTSCTS */
+	if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) {
+		spin_lock_irqsave(&state->port->lock, flags);
+		if (!(state->port->ops->get_mctrl(state->port) & TIOCM_CTS)) {
+			tty->hw_stopped = 1;
+			state->port->ops->stop_tx(state->port, 0);
+		}
+		spin_unlock_irqrestore(&state->port->lock, flags);
+	}
+
 #if 0
 	/*
 	 * No need to wake up processes in open wait, since they

  reply	other threads:[~2005-06-26 22:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26 22:15 [CFT:PATCH] 1/3: Adjust serial locking Russell King
2005-06-26 22:17 ` Russell King [this message]
2005-06-26 22:18   ` [CFT:PATCH] 3/3: Disable OX950 transmitter for flow control Russell King
2005-06-26 22:26   ` [CFT:PATCH] 2/3: Check status of CTS when using " Gene Heskett
2005-06-26 22:37     ` Russell King
2005-06-26 23:38       ` Gene Heskett
2005-06-27  8:05         ` Russell King
2005-06-27 16:40           ` Gene Heskett
2005-06-28 14:24   ` Russell King

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=20050626221750.GA5789@dyn-67.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome