diff options
Diffstat (limited to 'drivers/serial/bfin_5xx.c')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 676efdad3712..854e96dfb070 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -490,7 +490,7 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) | |||
490 | uart->rx_dma_nrows = get_dma_curr_ycount(uart->rx_dma_channel); | 490 | uart->rx_dma_nrows = get_dma_curr_ycount(uart->rx_dma_channel); |
491 | x_pos = get_dma_curr_xcount(uart->rx_dma_channel); | 491 | x_pos = get_dma_curr_xcount(uart->rx_dma_channel); |
492 | uart->rx_dma_nrows = DMA_RX_YCOUNT - uart->rx_dma_nrows; | 492 | uart->rx_dma_nrows = DMA_RX_YCOUNT - uart->rx_dma_nrows; |
493 | if (uart->rx_dma_nrows == DMA_RX_YCOUNT) | 493 | if (uart->rx_dma_nrows == DMA_RX_YCOUNT || x_pos == 0) |
494 | uart->rx_dma_nrows = 0; | 494 | uart->rx_dma_nrows = 0; |
495 | x_pos = DMA_RX_XCOUNT - x_pos; | 495 | x_pos = DMA_RX_XCOUNT - x_pos; |
496 | if (x_pos == DMA_RX_XCOUNT) | 496 | if (x_pos == DMA_RX_XCOUNT) |
@@ -546,15 +546,16 @@ static irqreturn_t bfin_serial_dma_rx_int(int irq, void *dev_id) | |||
546 | { | 546 | { |
547 | struct bfin_serial_port *uart = dev_id; | 547 | struct bfin_serial_port *uart = dev_id; |
548 | unsigned short irqstat; | 548 | unsigned short irqstat; |
549 | int pos; | 549 | int x_pos, pos; |
550 | 550 | ||
551 | spin_lock(&uart->port.lock); | 551 | spin_lock(&uart->port.lock); |
552 | irqstat = get_dma_curr_irqstat(uart->rx_dma_channel); | 552 | irqstat = get_dma_curr_irqstat(uart->rx_dma_channel); |
553 | clear_dma_irqstat(uart->rx_dma_channel); | 553 | clear_dma_irqstat(uart->rx_dma_channel); |
554 | 554 | ||
555 | uart->rx_dma_nrows = get_dma_curr_ycount(uart->rx_dma_channel); | 555 | uart->rx_dma_nrows = get_dma_curr_ycount(uart->rx_dma_channel); |
556 | x_pos = get_dma_curr_xcount(uart->rx_dma_channel); | ||
556 | uart->rx_dma_nrows = DMA_RX_YCOUNT - uart->rx_dma_nrows; | 557 | uart->rx_dma_nrows = DMA_RX_YCOUNT - uart->rx_dma_nrows; |
557 | if (uart->rx_dma_nrows == DMA_RX_YCOUNT) | 558 | if (uart->rx_dma_nrows == DMA_RX_YCOUNT || x_pos == 0) |
558 | uart->rx_dma_nrows = 0; | 559 | uart->rx_dma_nrows = 0; |
559 | 560 | ||
560 | pos = uart->rx_dma_nrows * DMA_RX_XCOUNT; | 561 | pos = uart->rx_dma_nrows * DMA_RX_XCOUNT; |