From: Marc Pignat <marc.pignat@hevs.ch>
To: Michael Trimarchi <trimarchimichael@yahoo.it>
Cc: linux-kernel@vger.kernel.org, Haavard Skinnemoen <hskinnemoen@atmel.com>
Subject: Re: [PATCH] atmel serial reduce trasmitting window & code style patch
Date: Tue, 8 Apr 2008 10:32:31 +0200 [thread overview]
Message-ID: <200804081032.32883.marc.pignat@hevs.ch> (raw)
In-Reply-To: <524838.25009.qm@web26206.mail.ukl.yahoo.com>
Hi all!
I just inlined your second patch for commenting.
On Thursday 03 April 2008, Michael Trimarchi wrote:
> Hi,
...
> http://it.docs.yahoo.com/mail/overview/index.html
> diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
> index 9f58eb3..511a0cc 100644
> --- a/drivers/serial/atmel_serial.c
> +++ b/drivers/serial/atmel_serial.c
> @@ -123,6 +123,7 @@ struct atmel_uart_char {
> };
>
> #define ATMEL_SERIAL_RINGSIZE 1024
> +#define ATMEL_SERIAL_TXSIZE 32
>
> /*
> * We wrap our port structure around the generic uart_port.
> @@ -426,6 +427,7 @@ static void atmel_rx_chars(struct uart_port *port)
> static void atmel_tx_chars(struct uart_port *port)
> {
> struct circ_buf *xmit = &port->info->xmit;
> + int count = 0;
> if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) {
> UART_PUT_CHAR(port, port->x_char);
> @@ -435,10 +437,12 @@ static void atmel_tx_chars(struct uart_port *port)
> if (uart_circ_empty(xmit) || uart_tx_stopped(port))
> return;
>
> - while (UART_GET_CSR(port) & ATMEL_US_TXRDY) {
> + while (UART_GET_CSR(port) & ATMEL_US_TXRDY &&
> + count < ATMEL_SERIAL_TXSIZE) {
> UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
> xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> port->icount.tx++;
> + count++;
> if (uart_circ_empty(xmit))
> break;
> }
For me this loop will never run more than 2-3 times.
The CPU is much faster than the serial transmitter, so after 2 loops
UART_GET_CSR(port) & ATMEL_US_TXRDY will be false and the loop will exit.
If your patch does something, I can't understand how!
Best regards
Marc
next prev parent reply other threads:[~2008-04-08 8:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-03 8:39 Michael Trimarchi
2008-04-06 20:46 ` Haavard Skinnemoen
2008-04-06 20:57 ` Haavard Skinnemoen
2008-04-07 8:14 ` Michael Trimarchi
2008-04-08 8:32 ` Marc Pignat [this message]
2008-04-08 8:44 ` Michael Trimarchi
2008-04-07 9:22 Michael Trimarchi
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=200804081032.32883.marc.pignat@hevs.ch \
--to=marc.pignat@hevs.ch \
--cc=hskinnemoen@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=trimarchimichael@yahoo.it \
/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®