aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2012-03-13 03:51:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-13 17:33:39 -0400
commit60f4b002ab209525c2b818703291ac9a14890e17 (patch)
tree60c771ae0b9cc03e7687f3486f38c3d5d0a6027a /drivers/tty
parent82896210aa3c59eaa4f78f7ba2f5f947601dd8f8 (diff)
serial: bfin-uart: Don't access tty circular buffer in TX DMA interrupt after it is reset.
When kernel reboot, tty circular buffer is reset before last TX DMA interrupt is called, while the buffer tail is updated in TX DMA interrupt handler. So, don't update the buffer tail if it is reset. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/bfin_uart.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 26953bfa6922..5832fdef11e9 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -535,11 +535,13 @@ static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id)
535 * when start a new tx. 535 * when start a new tx.
536 */ 536 */
537 UART_CLEAR_IER(uart, ETBEI); 537 UART_CLEAR_IER(uart, ETBEI);
538 xmit->tail = (xmit->tail + uart->tx_count) & (UART_XMIT_SIZE - 1);
539 uart->port.icount.tx += uart->tx_count; 538 uart->port.icount.tx += uart->tx_count;
539 if (!uart_circ_empty(xmit)) {
540 xmit->tail = (xmit->tail + uart->tx_count) & (UART_XMIT_SIZE - 1);
540 541
541 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 542 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
542 uart_write_wakeup(&uart->port); 543 uart_write_wakeup(&uart->port);
544 }
543 545
544 bfin_serial_dma_tx_chars(uart); 546 bfin_serial_dma_tx_chars(uart);
545 } 547 }