From: "Taku Izumi" <izumi2005@soft.fujitsu.com>
To: rmk+lkml@arm.linux.org.uk
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, hishii@soft.fujitsu.com
Subject: Re: performance-improvement-of-serial-console-via-virtual.patch added to -mm tree
Date: Thu, 15 Sep 2005 14:20:49 +0900 (JST) [thread overview]
Message-ID: <4356.10.124.102.246.1126761649.squirrel@dominion> (raw)
In-Reply-To: <01ac01c5b864$291f1370$dba0220a@CARREN>
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
Dear Russel:
I change my patch based on the result of discussion.
The change is as follows:
- add a member to uart_8250_port structure in order to check if FIFO is
enable or not.
- use FIFO at serial8250_console_write function only when FIFO is enable.
I tested my patch on i386 and ia64 architecture.
signed-off-by: Taku Izumi <izumi2005@soft.fujitsu.com>
[-- Attachment #2: serial.patch --]
[-- Type: text/plain, Size: 2779 bytes --]
diff -urNp linux-2.6.14-rc1.org/drivers/serial/8250.c linux-2.6.14-rc1/drivers/serial/8250.c
--- linux-2.6.14-rc1.org/drivers/serial/8250.c 2005-09-13 12:12:09.000000000 +0900
+++ linux-2.6.14-rc1/drivers/serial/8250.c 2005-09-15 09:38:46.000000000 +0900
@@ -128,6 +128,7 @@ struct uart_8250_port {
unsigned char mcr_mask; /* mask of user bits */
unsigned char mcr_force; /* mask of forced bits */
unsigned char lsr_break_flag;
+ unsigned char fcr;
/*
* We provide a per-port pm hook.
@@ -332,6 +333,7 @@ static unsigned int serial_icr_read(stru
static inline void serial8250_clear_fifos(struct uart_8250_port *p)
{
if (p->capabilities & UART_CAP_FIFO) {
+ p->fcr = 0;
serial_outp(p, UART_FCR, UART_FCR_ENABLE_FIFO);
serial_outp(p, UART_FCR, UART_FCR_ENABLE_FIFO |
UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
@@ -1809,8 +1811,10 @@ serial8250_set_termios(struct uart_port
* LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR
* is written without DLAB set, this mode will be disabled.
*/
- if (up->port.type == PORT_16750)
+ if (up->port.type == PORT_16750) {
serial_outp(up, UART_FCR, fcr);
+ up->fcr = fcr;
+ }
serial_outp(up, UART_LCR, cval); /* reset DLAB */
up->lcr = cval; /* Save LCR */
@@ -1820,6 +1824,7 @@ serial8250_set_termios(struct uart_port
serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
}
serial_outp(up, UART_FCR, fcr); /* set fcr */
+ up->fcr = fcr;
}
serial8250_set_mctrl(&up->port, up->port.mctrl);
spin_unlock_irqrestore(&up->port.lock, flags);
@@ -2140,6 +2145,7 @@ serial8250_console_write(struct console
struct uart_8250_port *up = &serial8250_ports[co->index];
unsigned int ier;
int i;
+ int tx_loadsz;
/*
* First save the UER then disable the interrupts
@@ -2152,20 +2158,39 @@ serial8250_console_write(struct console
serial_out(up, UART_IER, 0);
/*
+ * Check whether FIFO is enabled
+ */
+ tx_loadsz = (up->fcr & UART_FCR_ENABLE_FIFO ? up->tx_loadsz : 1);
+ /*
* Now, do each character
*/
- for (i = 0; i < count; i++, s++) {
- wait_for_xmitr(up);
+ for (i = 0; i < count; ) {
+ int fifo;
+ wait_for_xmitr(up);
+ fifo = tx_loadsz;
/*
- * Send the character out.
+ * Send the character out using FIFO.
* If a LF, also do CR...
*/
- serial_out(up, UART_TX, *s);
- if (*s == 10) {
- wait_for_xmitr(up);
- serial_out(up, UART_TX, 13);
- }
+ do {
+ serial_out(up, UART_TX, *s);
+ fifo--;
+ if (*s == 10) {
+ if (fifo > 0) {
+ serial_out(up, UART_TX, 13);
+ fifo--;
+ } else {
+ /* No room to add CR */
+ wait_for_xmitr(up);
+ fifo = tx_loadsz;
+ serial_out(up, UART_TX, 13);
+ fifo--;
+ }
+ }
+ i++;
+ s++;
+ } while (fifo > 0 && i < count);
}
/*
next prev parent reply other threads:[~2005-09-15 5:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200509072146.j87LkNv8004076@shell0.pdx.osdl.net>
[not found] ` <20050907224911.H19199@flint.arm.linux.org.uk>
2005-09-08 7:47 ` Taku Izumi
2005-09-13 8:17 ` Russell King
2005-09-13 11:44 ` Hironobu Ishii
2005-09-13 11:53 ` Russell King
2005-09-13 12:02 ` Russell King
2005-09-13 13:07 ` Hironobu Ishii
2005-09-15 5:20 ` Taku Izumi [this message]
2005-09-13 12:18 ` Hironobu Ishii
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=4356.10.124.102.246.1126761649.squirrel@dominion \
--to=izumi2005@soft.fujitsu.com \
--cc=akpm@osdl.org \
--cc=hishii@soft.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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®