Commit cf03a884 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Greg Kroah-Hartman

serial: clps711x: Improved TX FIFO handling

Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c08f0153
...@@ -155,7 +155,6 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) ...@@ -155,7 +155,6 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
struct uart_port *port = dev_id; struct uart_port *port = dev_id;
struct clps711x_port *s = dev_get_drvdata(port->dev); struct clps711x_port *s = dev_get_drvdata(port->dev);
struct circ_buf *xmit = &port->state->xmit; struct circ_buf *xmit = &port->state->xmit;
int count;
if (port->x_char) { if (port->x_char) {
clps_writel(port->x_char, UARTDR(port)); clps_writel(port->x_char, UARTDR(port));
...@@ -170,14 +169,13 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) ...@@ -170,14 +169,13 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
count = port->fifosize >> 1; while (!uart_circ_empty(xmit)) {
do { clps_writew(xmit->buf[xmit->tail], UARTDR(port));
clps_writel(xmit->buf[xmit->tail], UARTDR(port));
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
port->icount.tx++; port->icount.tx++;
if (uart_circ_empty(xmit)) if (clps_readl(SYSFLG(port) & SYSFLG_UTXFF))
break; break;
} while (--count > 0); }
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(port); uart_write_wakeup(port);
...@@ -327,7 +325,8 @@ clps711xuart_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -327,7 +325,8 @@ clps711xuart_set_termios(struct uart_port *port, struct ktermios *termios,
if (!(termios->c_cflag & PARODD)) if (!(termios->c_cflag & PARODD))
ubrlcr |= UBRLCR_EVENPRT; ubrlcr |= UBRLCR_EVENPRT;
} }
if (port->fifosize > 1)
/* Enable FIFO */
ubrlcr |= UBRLCR_FIFOEN; ubrlcr |= UBRLCR_FIFOEN;
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment