diff options
Diffstat (limited to 'drivers/serial/bfin_5xx.c')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 318d69dce8e1..f9b5a72e261a 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -174,10 +174,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) | |||
174 | return; | 174 | return; |
175 | } | 175 | } |
176 | 176 | ||
177 | if (!uart->port.info || !uart->port.info->tty) | 177 | if (!uart->port.info || !uart->port.info->port.tty) |
178 | return; | 178 | return; |
179 | #endif | 179 | #endif |
180 | tty = uart->port.info->tty; | 180 | tty = uart->port.info->port.tty; |
181 | 181 | ||
182 | if (ANOMALY_05000363) { | 182 | if (ANOMALY_05000363) { |
183 | /* The BF533 (and BF561) family of processors have a nice anomaly | 183 | /* The BF533 (and BF561) family of processors have a nice anomaly |
@@ -401,9 +401,11 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) | |||
401 | else | 401 | else |
402 | flg = TTY_NORMAL; | 402 | flg = TTY_NORMAL; |
403 | 403 | ||
404 | for (i = uart->rx_dma_buf.tail; i != uart->rx_dma_buf.head; i++) { | 404 | for (i = uart->rx_dma_buf.tail; ; i++) { |
405 | if (i >= UART_XMIT_SIZE) | 405 | if (i >= UART_XMIT_SIZE) |
406 | i = 0; | 406 | i = 0; |
407 | if (i == uart->rx_dma_buf.head) | ||
408 | break; | ||
407 | if (!uart_handle_sysrq_char(&uart->port, uart->rx_dma_buf.buf[i])) | 409 | if (!uart_handle_sysrq_char(&uart->port, uart->rx_dma_buf.buf[i])) |
408 | uart_insert_char(&uart->port, status, OE, | 410 | uart_insert_char(&uart->port, status, OE, |
409 | uart->rx_dma_buf.buf[i], flg); | 411 | uart->rx_dma_buf.buf[i], flg); |
@@ -415,7 +417,8 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) | |||
415 | 417 | ||
416 | void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) | 418 | void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) |
417 | { | 419 | { |
418 | int x_pos, pos, flags; | 420 | int x_pos, pos; |
421 | unsigned long flags; | ||
419 | 422 | ||
420 | spin_lock_irqsave(&uart->port.lock, flags); | 423 | spin_lock_irqsave(&uart->port.lock, flags); |
421 | 424 | ||
@@ -757,7 +760,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
757 | } | 760 | } |
758 | 761 | ||
759 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); | 762 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); |
760 | quot = uart_get_divisor(port, baud); | 763 | quot = uart_get_divisor(port, baud) - ANOMALY_05000230; |
761 | spin_lock_irqsave(&uart->port.lock, flags); | 764 | spin_lock_irqsave(&uart->port.lock, flags); |
762 | 765 | ||
763 | UART_SET_ANOMALY_THRESHOLD(uart, USEC_PER_SEC / baud * 15); | 766 | UART_SET_ANOMALY_THRESHOLD(uart, USEC_PER_SEC / baud * 15); |
@@ -1088,7 +1091,7 @@ static void | |||
1088 | bfin_serial_console_write(struct console *co, const char *s, unsigned int count) | 1091 | bfin_serial_console_write(struct console *co, const char *s, unsigned int count) |
1089 | { | 1092 | { |
1090 | struct bfin_serial_port *uart = &bfin_serial_ports[co->index]; | 1093 | struct bfin_serial_port *uart = &bfin_serial_ports[co->index]; |
1091 | int flags = 0; | 1094 | unsigned long flags; |
1092 | 1095 | ||
1093 | spin_lock_irqsave(&uart->port.lock, flags); | 1096 | spin_lock_irqsave(&uart->port.lock, flags); |
1094 | uart_console_write(&uart->port, s, count, bfin_serial_console_putchar); | 1097 | uart_console_write(&uart->port, s, count, bfin_serial_console_putchar); |