diff options
| -rw-r--r-- | drivers/tty/serial/8250/8250_dma.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index 7046769608d4..ab9096dc3849 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c | |||
| @@ -20,12 +20,15 @@ static void __dma_tx_complete(void *param) | |||
| 20 | struct uart_8250_port *p = param; | 20 | struct uart_8250_port *p = param; |
| 21 | struct uart_8250_dma *dma = p->dma; | 21 | struct uart_8250_dma *dma = p->dma; |
| 22 | struct circ_buf *xmit = &p->port.state->xmit; | 22 | struct circ_buf *xmit = &p->port.state->xmit; |
| 23 | 23 | unsigned long flags; | |
| 24 | dma->tx_running = 0; | ||
| 25 | 24 | ||
| 26 | dma_sync_single_for_cpu(dma->txchan->device->dev, dma->tx_addr, | 25 | dma_sync_single_for_cpu(dma->txchan->device->dev, dma->tx_addr, |
| 27 | UART_XMIT_SIZE, DMA_TO_DEVICE); | 26 | UART_XMIT_SIZE, DMA_TO_DEVICE); |
| 28 | 27 | ||
| 28 | spin_lock_irqsave(&p->port.lock, flags); | ||
| 29 | |||
| 30 | dma->tx_running = 0; | ||
| 31 | |||
| 29 | xmit->tail += dma->tx_size; | 32 | xmit->tail += dma->tx_size; |
| 30 | xmit->tail &= UART_XMIT_SIZE - 1; | 33 | xmit->tail &= UART_XMIT_SIZE - 1; |
| 31 | p->port.icount.tx += dma->tx_size; | 34 | p->port.icount.tx += dma->tx_size; |
| @@ -35,6 +38,8 @@ static void __dma_tx_complete(void *param) | |||
| 35 | 38 | ||
| 36 | if (!uart_circ_empty(xmit) && !uart_tx_stopped(&p->port)) | 39 | if (!uart_circ_empty(xmit) && !uart_tx_stopped(&p->port)) |
| 37 | serial8250_tx_dma(p); | 40 | serial8250_tx_dma(p); |
| 41 | |||
| 42 | spin_unlock_irqrestore(&p->port.lock, flags); | ||
| 38 | } | 43 | } |
| 39 | 44 | ||
| 40 | static void __dma_rx_complete(void *param) | 45 | static void __dma_rx_complete(void *param) |
