lkml.org 
[lkml]   [2009]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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.



    \
     
     \ /
      Last update: 2009-11-12 23:27    [W:0.026 / U:62.748 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site