Messages in this thread | | | Date | Thu, 12 Nov 2009 14:24:50 -0800 | From | Andrew Morton <> | 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@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.
| |