From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [CFT:PATCH] 3/3: Disable OX950 transmitter for flow control
Date: Sun, 26 Jun 2005 23:18:48 +0100 [thread overview]
Message-ID: <20050626221848.GB5789@dyn-67.arm.linux.org.uk> (raw)
In-Reply-To: <20050626221750.GA5789@dyn-67.arm.linux.org.uk>
Disable the transmitter whenever we want to prevent characters
being transmitted by flow control. However, if we run out of
characters to send and want to only disable the TX interrupt,
allow that scenario.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Index: drivers/serial/8250.c
===================================================================
--- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/serial/8250.c (mode:100644)
+++ uncommitted/drivers/serial/8250.c (mode:100644)
@@ -1007,21 +1007,24 @@
up->port.irq = (irq > 0) ? irq : 0;
}
+static inline void __stop_tx(struct uart_8250_port *p)
+{
+ if (p->ier & UART_IER_THRI) {
+ p->ier &= ~UART_IER_THRI;
+ serial_out(p, UART_IER, p->ier);
+ }
+}
+
static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop)
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
- if (up->ier & UART_IER_THRI) {
- up->ier &= ~UART_IER_THRI;
- serial_out(up, UART_IER, up->ier);
- }
+ __stop_tx(up);
/*
- * We only do this from uart_stop - if we run out of
- * characters to send, we don't want to prevent the
- * FIFO from emptying.
+ * We really want to stop the transmitter from sending.
*/
- if (up->port.type == PORT_16C950 && tty_stop) {
+ if (up->port.type == PORT_16C950) {
up->acr |= UART_ACR_TXDIS;
serial_icr_write(up, UART_ACR, up->acr);
}
@@ -1045,10 +1048,11 @@
transmit_chars(up);
}
}
+
/*
- * We only do this from uart_start
+ * Re-enable the transmitter if we disabled it.
*/
- if (tty_start && up->port.type == PORT_16C950) {
+ if (up->port.type == PORT_16C950 && up->acr & UART_ACR_TXDIS) {
up->acr &= ~UART_ACR_TXDIS;
serial_icr_write(up, UART_ACR, up->acr);
}
@@ -1169,7 +1173,7 @@
return;
}
if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
- serial8250_stop_tx(&up->port, 0);
+ __stop_tx(up);
return;
}
@@ -1188,7 +1192,7 @@
DEBUG_INTR("THRE...");
if (uart_circ_empty(xmit))
- serial8250_stop_tx(&up->port, 0);
+ __stop_tx(up);
}
static _INLINE_ void check_modem_status(struct uart_8250_port *up)
next prev parent reply other threads:[~2005-06-26 22:19 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 ` [CFT:PATCH] 2/3: Check status of CTS when using flow control Russell King
2005-06-26 22:18 ` Russell King [this message]
2005-06-26 22:26 ` 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=20050626221848.GB5789@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
all inboxes | Powered by JetHome®