X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2Famba-pl011.c;h=ff658a830f3401ea9c0f3932abc2ed12599acb5e;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=69bd7f5ce91ae41812f9972134c7b4639ae60a55;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 69bd7f5ce..ff658a830 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -32,26 +32,26 @@ * and hooked into this driver. */ #include + +#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#define SUPPORT_SYSRQ +#endif + #include -#include #include #include -#include #include #include #include +#include +#include +#include +#include #include #include #include #include - -#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) -#define SUPPORT_SYSRQ -#endif - -#include - #include #define UART_NR 14 @@ -115,22 +115,21 @@ pl011_rx_chars(struct uart_amba_port *uap) #endif { struct tty_struct *tty = uap->port.info->tty; - unsigned int status, ch, rsr, max_count = 256; + unsigned int status, ch, flag, rsr, max_count = 256; status = readw(uap->port.membase + UART01x_FR); while ((status & UART01x_FR_RXFE) == 0 && max_count--) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty->flip.work.func((void *)tty); - if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - printk(KERN_WARNING "TTY_DONT_FLIP set\n"); - return; - } + if (tty->low_latency) + tty_flip_buffer_push(tty); + /* + * If this failed then we will throw away the + * bytes but must do so to clear interrupts + */ } ch = readw(uap->port.membase + UART01x_DR); - - *tty->flip.char_buf_ptr = ch; - *tty->flip.flag_buf_ptr = TTY_NORMAL; + flag = TTY_NORMAL; uap->port.icount.rx++; /* @@ -154,20 +153,18 @@ pl011_rx_chars(struct uart_amba_port *uap) rsr &= uap->port.read_status_mask; if (rsr & UART01x_RSR_BE) - *tty->flip.flag_buf_ptr = TTY_BREAK; + flag = TTY_BREAK; else if (rsr & UART01x_RSR_PE) - *tty->flip.flag_buf_ptr = TTY_PARITY; + flag = TTY_PARITY; else if (rsr & UART01x_RSR_FE) - *tty->flip.flag_buf_ptr = TTY_FRAME; + flag = TTY_FRAME; } if (uart_handle_sysrq_char(&uap->port, ch, regs)) goto ignore_char; if ((rsr & uap->port.ignore_status_mask) == 0) { - tty->flip.flag_buf_ptr++; - tty->flip.char_buf_ptr++; - tty->flip.count++; + tty_insert_flip_char(tty, ch, flag); } if ((rsr & UART01x_RSR_OE) && tty->flip.count < TTY_FLIPBUF_SIZE) { @@ -176,9 +173,7 @@ pl011_rx_chars(struct uart_amba_port *uap) * immediately, and doesn't affect the current * character */ - *tty->flip.char_buf_ptr++ = 0; - *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; - tty->flip.count++; + tty_insert_flip_char(tty, 0, TTY_OVERRUN); } ignore_char: status = readw(uap->port.membase + UART01x_FR); @@ -745,7 +740,7 @@ static struct uart_driver amba_reg = { static int pl011_probe(struct amba_device *dev, void *id) { struct uart_amba_port *uap; - void *base; + void __iomem *base; int i, ret; for (i = 0; i < ARRAY_SIZE(amba_ports); i++)