[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20091112142450.d3c2dc90.akpm@linux-foundation.org>
Date: Thu, 12 Nov 2009 14:24:50 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Albin Tonnerre <albin.tonnerre@...e-electrons.com>
Cc: avictor.za@...il.com, linux-kernel@...r.kernel.org,
haavard.skinnemoen@...el.com, nicolas.ferre@...el.com
Subject: Re: [PATCH v2] Add poll_get_char and poll_put_char uart_ops to
atmel_serial.
On Mon, 7 Sep 2009 11:52:50 +0200
Albin Tonnerre <albin.tonnerre@...e-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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists