Re: [PATCH v2] Add poll_get_char and poll_put_char uart_ops toatmel_serial.
From: Andrew Morton
Date: Thu Nov 12 2009 - 17:25:48 EST
On Mon, 7 Sep 2009 11:52:50 +0200
Albin Tonnerre <albin.tonnerre@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/