diff options
Diffstat (limited to 'drivers/serial/bfin_5xx.c')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 88449d36a3f7..1c85039d021f 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -81,7 +81,9 @@ static void bfin_serial_reset_irda(struct uart_port *port); | |||
81 | static void bfin_serial_stop_tx(struct uart_port *port) | 81 | static void bfin_serial_stop_tx(struct uart_port *port) |
82 | { | 82 | { |
83 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 83 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
84 | #ifdef CONFIG_SERIAL_BFIN_DMA | ||
84 | struct circ_buf *xmit = &uart->port.info->xmit; | 85 | struct circ_buf *xmit = &uart->port.info->xmit; |
86 | #endif | ||
85 | 87 | ||
86 | while (!(UART_GET_LSR(uart) & TEMT)) | 88 | while (!(UART_GET_LSR(uart) & TEMT)) |
87 | cpu_relax(); | 89 | cpu_relax(); |
@@ -412,7 +414,9 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) | |||
412 | 414 | ||
413 | void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) | 415 | void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) |
414 | { | 416 | { |
415 | int x_pos, pos; | 417 | int x_pos, pos, flags; |
418 | |||
419 | spin_lock_irqsave(&uart->port.lock, flags); | ||
416 | 420 | ||
417 | uart->rx_dma_nrows = get_dma_curr_ycount(uart->rx_dma_channel); | 421 | uart->rx_dma_nrows = get_dma_curr_ycount(uart->rx_dma_channel); |
418 | x_pos = get_dma_curr_xcount(uart->rx_dma_channel); | 422 | x_pos = get_dma_curr_xcount(uart->rx_dma_channel); |
@@ -430,6 +434,8 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) | |||
430 | uart->rx_dma_buf.tail = uart->rx_dma_buf.head; | 434 | uart->rx_dma_buf.tail = uart->rx_dma_buf.head; |
431 | } | 435 | } |
432 | 436 | ||
437 | spin_unlock_irqrestore(&uart->port.lock, flags); | ||
438 | |||
433 | mod_timer(&(uart->rx_dma_timer), jiffies + DMA_RX_FLUSH_JIFFIES); | 439 | mod_timer(&(uart->rx_dma_timer), jiffies + DMA_RX_FLUSH_JIFFIES); |
434 | } | 440 | } |
435 | 441 | ||
@@ -464,10 +470,9 @@ static irqreturn_t bfin_serial_dma_rx_int(int irq, void *dev_id) | |||
464 | spin_lock(&uart->port.lock); | 470 | spin_lock(&uart->port.lock); |
465 | irqstat = get_dma_curr_irqstat(uart->rx_dma_channel); | 471 | irqstat = get_dma_curr_irqstat(uart->rx_dma_channel); |
466 | clear_dma_irqstat(uart->rx_dma_channel); | 472 | clear_dma_irqstat(uart->rx_dma_channel); |
473 | bfin_serial_dma_rx_chars(uart); | ||
467 | spin_unlock(&uart->port.lock); | 474 | spin_unlock(&uart->port.lock); |
468 | 475 | ||
469 | mod_timer(&(uart->rx_dma_timer), jiffies); | ||
470 | |||
471 | return IRQ_HANDLED; | 476 | return IRQ_HANDLED; |
472 | } | 477 | } |
473 | #endif | 478 | #endif |