From: Andrew Morton <akpm@linux-foundation.org>
To: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Cc: avictor.za@gmail.com, linux-kernel@vger.kernel.org,
haavard.skinnemoen@atmel.com, nicolas.ferre@atmel.com
Subject: Re: [PATCH v2] Add poll_get_char and poll_put_char uart_ops to atmel_serial.
Date: Thu, 12 Nov 2009 14:24:50 -0800 [thread overview]
Message-ID: <20091112142450.d3c2dc90.akpm@linux-foundation.org> (raw)
In-Reply-To: <1252317170-9782-1-git-send-email-albin.tonnerre@free-electrons.com>
On Mon, 7 Sep 2009 11:52:50 +0200
Albin Tonnerre <albin.tonnerre@free-electrons.com> wrote:
> +#ifdef CONFIG_CONSOLE_POLL
> +static int atmel_poll_get_char(struct uart_port *port)
> +{
> + while (!(UART_GET_CSR(port) & ATMEL_US_RXRDY))
> + barrier();
> +
> + return UART_GET_CHAR(port);
> +}
> +
> +static void atmel_poll_put_char(struct uart_port *port, unsigned char ch)
> +{
> + while (!(UART_GET_CSR(port) & ATMEL_US_TXRDY))
> + barrier();
> +
> + UART_PUT_CHAR(port, ch);
> +}
> +#endif
The use of barrier() is not appropriate here - it's purely a compiler
concept.
I'll switch it to cpu_relax(). Even that's probably unneeded, as the
IO operation is usually slow and should be an opportunity for the CPU
to take a little nap.
prev parent reply other threads:[~2009-11-12 22:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 9:05 [PATCH] Add poll_get_char and poll_put_char uart_ops to atmel_serial Albin Tonnerre
2009-07-27 14:23 ` Haavard Skinnemoen
2009-07-27 15:19 ` Albin Tonnerre
2009-07-28 16:09 ` Haavard Skinnemoen
2009-09-04 15:34 ` Albin Tonnerre
2009-09-07 6:22 ` Andrew Victor
2009-09-07 9:52 ` [PATCH v2] " Albin Tonnerre
2009-09-07 18:17 ` Andrew Victor
2009-09-08 8:30 ` Haavard Skinnemoen
2009-09-11 11:31 ` Albin Tonnerre
2009-10-10 18:57 ` Albin Tonnerre
2009-11-11 11:37 ` Albin Tonnerre
2009-11-12 22:24 ` Andrew Morton [this message]
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=20091112142450.d3c2dc90.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=albin.tonnerre@free-electrons.com \
--cc=avictor.za@gmail.com \
--cc=haavard.skinnemoen@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@atmel.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