Skip to content

Commit

Permalink
serial: bfin-uart: Don't access tty circular buffer in TX DMA interru…
Browse files Browse the repository at this point in the history
…pt 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>
  • Loading branch information
Sonic Zhang authored and Greg Kroah-Hartman committed Mar 13, 2012
1 parent 8289621 commit 60f4b00
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/tty/serial/bfin_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,13 @@ static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id)
* when start a new tx.
*/
UART_CLEAR_IER(uart, ETBEI);
xmit->tail = (xmit->tail + uart->tx_count) & (UART_XMIT_SIZE - 1);
uart->port.icount.tx += uart->tx_count;
if (!uart_circ_empty(xmit)) {
xmit->tail = (xmit->tail + uart->tx_count) & (UART_XMIT_SIZE - 1);

if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(&uart->port);
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(&uart->port);
}

bfin_serial_dma_tx_chars(uart);
}
Expand Down

0 comments on commit 60f4b00

Please sign in to comment.